Commit 21bbeb78 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Increase clear browsing data timeout to 45s.

Sometimes clear browsing data times out on the bots.  This happens currently
with iOS12, but is happening much more regularly with iOS13.

Bug: 979728
Change-Id: I8e5105925b0365681fe5d6e9e5e4735e546100b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750863
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686562}
parent 72da138a
...@@ -33,6 +33,12 @@ extern const NSTimeInterval kWaitForPageLoadTimeout; ...@@ -33,6 +33,12 @@ extern const NSTimeInterval kWaitForPageLoadTimeout;
// complete. // complete.
extern const NSTimeInterval kWaitForActionTimeout; extern const NSTimeInterval kWaitForActionTimeout;
// Constant for timeout in seconds while waiting for clear browsing data. It
// seems this can take a very long time on the bots when running simulators in
// parallel. TODO(crbug.com/993513): Investigate why this is sometimes very
// slow.
extern const NSTimeInterval kWaitForClearBrowsingDataTimeout;
// Constant for timeout in seconds while waiting for cookies operations to // Constant for timeout in seconds while waiting for cookies operations to
// complete. // complete.
extern const NSTimeInterval kWaitForCookiesTimeout; extern const NSTimeInterval kWaitForCookiesTimeout;
......
...@@ -22,6 +22,7 @@ const NSTimeInterval kWaitForUIElementTimeout = 4.0; ...@@ -22,6 +22,7 @@ const NSTimeInterval kWaitForUIElementTimeout = 4.0;
const NSTimeInterval kWaitForDownloadTimeout = 10.0; const NSTimeInterval kWaitForDownloadTimeout = 10.0;
const NSTimeInterval kWaitForPageLoadTimeout = 10.0; const NSTimeInterval kWaitForPageLoadTimeout = 10.0;
const NSTimeInterval kWaitForActionTimeout = 10.0; const NSTimeInterval kWaitForActionTimeout = 10.0;
const NSTimeInterval kWaitForClearBrowsingDataTimeout = 45.0;
const NSTimeInterval kWaitForCookiesTimeout = 4.0; const NSTimeInterval kWaitForCookiesTimeout = 4.0;
const NSTimeInterval kWaitForFileOperationTimeout = 2.0; const NSTimeInterval kWaitForFileOperationTimeout = 2.0;
......
...@@ -86,8 +86,10 @@ void RemoveBrowsingData() { ...@@ -86,8 +86,10 @@ void RemoveBrowsingData() {
block:^BOOL { block:^BOOL {
return browsing_data_removed; return browsing_data_removed;
}]; }];
GREYAssert([condition waitWithTimeout:base::test::ios::kWaitForActionTimeout], GREYAssert(
@"Browsing data was not removed."); [condition
waitWithTimeout:base::test::ios::kWaitForClearBrowsingDataTimeout],
@"Browsing data was not removed.");
} }
} // namespace } // namespace
......
...@@ -158,11 +158,12 @@ char kResponse3[] = "Test Page 3 content"; ...@@ -158,11 +158,12 @@ char kResponse3[] = "Test Page 3 content";
[[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()]
performAction:grey_tap()]; performAction:grey_tap()];
// Swipe over to Recent Tabs
[[EarlGrey selectElementWithMatcher:grey_accessibilityID( // Switch over to Recent Tabs.
kTabGridScrollViewIdentifier)] [[EarlGrey
performAction:[GREYActions selectElementWithMatcher:grey_accessibilityID(
actionForSwipeFastInDirection:kGREYDirectionLeft]]; kTabGridRemoteTabsPageButtonIdentifier)]
performAction:grey_tap()];
// Tap on "Show History" // Tap on "Show History"
// Undo is available after close all action. // Undo is available after close all action.
......
...@@ -27,7 +27,7 @@ bool ClearBrowsingHistory() { ...@@ -27,7 +27,7 @@ bool ClearBrowsingHistory() {
did_complete = true; did_complete = true;
}]; }];
return base::test::ios::WaitUntilConditionOrTimeout( return base::test::ios::WaitUntilConditionOrTimeout(
base::test::ios::kWaitForUIElementTimeout, ^{ base::test::ios::kWaitForClearBrowsingDataTimeout, ^{
return did_complete; return did_complete;
}); });
} }
......
...@@ -121,6 +121,21 @@ bool IsAppCompactWidth() { ...@@ -121,6 +121,21 @@ bool IsAppCompactWidth() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:chrome_test_util::ClearCacheButton()] [[EarlGrey selectElementWithMatcher:chrome_test_util::ClearCacheButton()]
performAction:grey_tap()]; performAction:grey_tap()];
// Set 'Time Range' to 'All Time'.
[[EarlGrey selectElementWithMatcher:
chrome_test_util::ButtonWithAccessibilityLabelId(
IDS_IOS_CLEAR_BROWSING_DATA_TIME_RANGE_SELECTOR_TITLE)]
performAction:grey_tap()];
[[EarlGrey
selectElementWithMatcher:
chrome_test_util::ButtonWithAccessibilityLabelId(
IDS_IOS_CLEAR_BROWSING_DATA_TIME_RANGE_OPTION_BEGINNING_OF_TIME)]
performAction:grey_tap()];
[[[EarlGrey
selectElementWithMatcher:chrome_test_util::SettingsMenuBackButton()]
atIndex:0] performAction:grey_tap()];
[[EarlGrey [[EarlGrey
selectElementWithMatcher:chrome_test_util::ClearBrowsingDataButton()] selectElementWithMatcher:chrome_test_util::ClearBrowsingDataButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -131,6 +146,12 @@ bool IsAppCompactWidth() { ...@@ -131,6 +146,12 @@ bool IsAppCompactWidth() {
// data has been finished. // data has been finished.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
// Recheck "Cookies, Site Data" and "Cached Images and Files."
[[EarlGrey selectElementWithMatcher:chrome_test_util::ClearCookiesButton()]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:chrome_test_util::ClearCacheButton()]
performAction:grey_tap()];
// Include sufficientlyVisible condition for the case of the clear browsing // Include sufficientlyVisible condition for the case of the clear browsing
// dialog, which also has a "Done" button and is displayed over the history // dialog, which also has a "Done" button and is displayed over the history
// panel. // panel.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment