Index: ios/chrome/browser/ui/stack_view/stack_view_egtest.mm |
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_egtest.mm b/ios/chrome/browser/ui/stack_view/stack_view_egtest.mm |
index 6d2f88fcccce4ea72a79d2f603bd590b1b6bd6a0..4c791b5e5e5a2c7fe309374d32b70c0f117dfb9a 100644 |
--- a/ios/chrome/browser/ui/stack_view/stack_view_egtest.mm |
+++ b/ios/chrome/browser/ui/stack_view/stack_view_egtest.mm |
@@ -52,6 +52,21 @@ |
// Waits for the Stack View to be visible/hidden. |
void CheckForStackViewVisibility(bool visible) { |
+ // Wait for the tab switcher to be active or inactive. |
+ NSString* activeTabSwitcherDescription = |
+ [NSString stringWithFormat:@"Waiting for tab switcher to be %@.", |
+ visible ? @"active" : @"inactive"]; |
Eugene But (OOO till 7-30)
2017/02/23 19:11:25
I'm confused about mixing is_visible and is_active
kkhorimoto
2017/03/07 06:46:51
separated out into two different checks.
|
+ BOOL (^activeTabSwitcherBlock) |
+ () = ^BOOL { |
Eugene But (OOO till 7-30)
2017/02/23 19:11:25
Is this done by clang format? If so, could you ple
kkhorimoto
2017/03/07 06:46:51
Done.
|
+ BOOL isActive = chrome_test_util::GetStackViewController() != nil && |
Eugene But (OOO till 7-30)
2017/02/23 19:11:25
nit: no need for |!= nil|
kkhorimoto
2017/03/07 06:46:51
Done.
|
+ chrome_test_util::IsTabSwitcherActive(); |
+ return visible ? isActive : !isActive; |
+ }; |
+ GREYCondition* activeTabSwitcherCondition = |
+ [GREYCondition conditionWithName:activeTabSwitcherDescription |
+ block:activeTabSwitcherBlock]; |
+ [activeTabSwitcherCondition waitWithTimeout:5.0]; |
Eugene But (OOO till 7-30)
2017/02/23 19:11:25
Do you want to use kWaitForUIElementTimeout instea
kkhorimoto
2017/03/07 06:46:51
Done.
|
+ // Verify the visibility of the stack view. |
id<GREYMatcher> visibilityMatcher = |
grey_allOf(visible ? grey_sufficientlyVisible() : grey_notVisible(), |
visible ? grey_notNil() : grey_nil(), nil); |
@@ -187,13 +202,7 @@ - (void)testCloseTab { |
} |
// Tests closing all Tabs in the stack view. |
-// TODO(crbug.com/693517): Re-enable this test on simulator. |
-#if TARGET_IPHONE_SIMULATOR |
-#define MAYBE_testCloseAllTabs FLAKY_testCloseAllTabs |
-#else |
-#define MAYBE_testCloseAllTabs testCloseAllTabs |
-#endif |
-- (void)MAYBE_testCloseAllTabs { |
+- (void)testCloseAllTabs { |
// The StackViewController is only used on iPhones. |
if (IsIPadIdiom()) |
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads."); |