| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <XCTest/XCTest.h> | 5 #import <XCTest/XCTest.h> |
| 6 | 6 |
| 7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
| 8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "base/test/ios/wait_util.h" | 10 #import "base/test/ios/wait_util.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(identifier)] | 180 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(identifier)] |
| 181 performAction:grey_tap()]; | 181 performAction:grey_tap()]; |
| 182 // Verify that the CardView and its associated Tab were removed. | 182 // Verify that the CardView and its associated Tab were removed. |
| 183 [[EarlGrey selectElementWithMatcher:ViewMatchingView(cardView)] | 183 [[EarlGrey selectElementWithMatcher:ViewMatchingView(cardView)] |
| 184 assertWithMatcher:grey_notVisible()]; | 184 assertWithMatcher:grey_notVisible()]; |
| 185 GREYAssertEqual(chrome_test_util::GetMainTabCount(), 0, | 185 GREYAssertEqual(chrome_test_util::GetMainTabCount(), 0, |
| 186 @"All Tabs should be closed."); | 186 @"All Tabs should be closed."); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Tests closing all Tabs in the stack view. | 189 // Tests closing all Tabs in the stack view. |
| 190 - (void)testCloseAllTabs { | 190 // TODO(crbug.com/693517): Re-enable this test on simulator. |
| 191 #if TARGET_IPHONE_SIMULATOR |
| 192 #define MAYBE_testCloseAllTabs FLAKY_testCloseAllTabs |
| 193 #else |
| 194 #define MAYBE_testCloseAllTabs testCloseAllTabs |
| 195 #endif |
| 196 - (void)MAYBE_testCloseAllTabs { |
| 191 // The StackViewController is only used on iPhones. | 197 // The StackViewController is only used on iPhones. |
| 192 if (IsIPadIdiom()) | 198 if (IsIPadIdiom()) |
| 193 EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads."); | 199 EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads."); |
| 194 // Open an incognito Tab. | 200 // Open an incognito Tab. |
| 195 OpenNewIncognitoTabUsingStackView(); | 201 OpenNewIncognitoTabUsingStackView(); |
| 196 GREYAssertEqual(chrome_test_util::GetIncognitoTabCount(), 1, | 202 GREYAssertEqual(chrome_test_util::GetIncognitoTabCount(), 1, |
| 197 @"Incognito Tab was not opened."); | 203 @"Incognito Tab was not opened."); |
| 198 // Open two additional Tabs. | 204 // Open two additional Tabs. |
| 199 const NSUInteger kAdditionalTabCount = 2; | 205 const NSUInteger kAdditionalTabCount = 2; |
| 200 for (NSUInteger i = 0; i < kAdditionalTabCount; ++i) | 206 for (NSUInteger i = 0; i < kAdditionalTabCount; ++i) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 chrome_test_util::GetStackViewController(); | 250 chrome_test_util::GetStackViewController(); |
| 245 GREYAssert([stackViewController isCurrentSetIncognito], | 251 GREYAssert([stackViewController isCurrentSetIncognito], |
| 246 @"Incognito deck not selected."); | 252 @"Incognito deck not selected."); |
| 247 // Switch back to the main CardSet and verify that is selected. | 253 // Switch back to the main CardSet and verify that is selected. |
| 248 ShowDeckWithType(DeckType::NORMAL); | 254 ShowDeckWithType(DeckType::NORMAL); |
| 249 GREYAssert(![stackViewController isCurrentSetIncognito], | 255 GREYAssert(![stackViewController isCurrentSetIncognito], |
| 250 @"Normal deck not selected."); | 256 @"Normal deck not selected."); |
| 251 } | 257 } |
| 252 | 258 |
| 253 @end | 259 @end |
| OLD | NEW |