Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm

Issue 2602943002: Fix flake in TabUsageRecorder egtests. (Closed)
Patch Set: BOOL -> bool Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
index 969d354269b60aaabfad9971a9fe0bc1b32e6eb5..62129219c14f32f97bd95213654c59385b05ba2f 100644
--- a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
+++ b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
@@ -124,7 +124,12 @@ void OpenNewIncognitoTabUsingUIAndEvictMainTabs() {
[[EarlGrey selectElementWithMatcher:new_incognito_tab_button_matcher]
performAction:grey_tap()];
chrome_test_util::AssertIncognitoTabCount(nb_incognito_tab + 1);
-
+ ConditionBlock condition = ^bool {
+ return chrome_test_util::IsIncognitoMode();
+ };
+ GREYAssert(
+ testing::WaitUntilConditionOrTimeout(kWaitElementTimeout, condition),
+ @"Waiting switch to incognito mode.");
chrome_test_util::EvictOtherTabModelTabs();
}
@@ -183,13 +188,17 @@ void SwitchToNormalMode() {
[[EarlGrey selectElementWithMatcher:
chrome_test_util::buttonWithAccessibilityLabelId(
IDS_IOS_TOOLS_MENU_NEW_INCOGNITO_TAB)]
- performAction:grey_swipeFastInDirection(kGREYDirectionRight)];
+ performAction:grey_swipeSlowInDirection(kGREYDirectionRight)];
[[EarlGrey selectElementWithMatcher:
chrome_test_util::buttonWithAccessibilityLabelId(
IDS_IOS_TOOLBAR_SHOW_TABS)] performAction:grey_tap()];
}
- GREYAssertFalse(chrome_test_util::IsIncognitoMode(),
- @"Switching to normal mode failed.");
+ ConditionBlock condition = ^bool {
+ return !chrome_test_util::IsIncognitoMode();
+ };
+ GREYAssert(
+ testing::WaitUntilConditionOrTimeout(kWaitElementTimeout, condition),
+ @"Waiting switch to normal mode.");
}
// Check that the error page is visible.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698