[ios] Move multiwindow cleanup to base ChromeTestCase class
Updated doc too.
Bug: 1135174
Change-Id: I5aacf0e6a7989e9dab6496c5f08c74bee6f5720a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752227
Reviewed-by: Stepan Khapugin <[email protected]>
Reviewed-by: Mark Cogan <[email protected]>
Commit-Queue: David Jean <[email protected]>
Cr-Commit-Position: refs/heads/master@{#861980}
diff --git a/docs/ios/multiwindow_eg_tests.md b/docs/ios/multiwindow_eg_tests.md
index a1273cf..e16fe46 100644
--- a/docs/ios/multiwindow_eg_tests.md
+++ b/docs/ios/multiwindow_eg_tests.md
@@ -279,29 +279,11 @@
## setUp/tearDown/test
-The setUp method does not need any changes. tearDown however needs to cleanup
-two things: extra window(s) and root matcher. A tearDown like this:
-
-```
-- (void)tearDown {
- [super tearDown];
- [ReadingListAppInterface resetConnectionType];
-}
-```
-
-Should become like this:
-
-```
-- (void)tearDown {
- [ChromeEarlGrey closeAllExtraWindows];
- [EarlGrey setRootMatcherForSubsequentInteractions:nil];
- [super tearDown];
- [ReadingListAppInterface resetConnectionType];
-}
-```
-
-If any multiwindow tests are present in that suite. Failure to clear extra
-windows at the end of a test, means a more than likely failure on the next one.
+In multiwindow tests, a failure to clear extra windows and root matcher at the
+end of a test, would mean a more than likely failure on the next one. To do so,
+the setUp/tearDown methods do not need any changes. ```closeAllExtraWindows```
+and ```[EarlGrey setRootMatcherForSubsequentInteractions:nil]``` are called on
+```[ChromeTestCase tearDown]``` and ```[ChromeTestCase setUpForTestCase]```.
Tests should check if multiwindow is available on their first lines, to avoid
failing on iPhones: