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

Unified Diff: ios/chrome/browser/web/browsing_prevent_default_egtest.mm

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: review comments Created 3 years, 6 months 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 | « ios/chrome/browser/web/browsing_egtest.mm ('k') | ios/chrome/browser/web/cache_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/browsing_prevent_default_egtest.mm
diff --git a/ios/chrome/browser/web/browsing_prevent_default_egtest.mm b/ios/chrome/browser/web/browsing_prevent_default_egtest.mm
index 61ae6d37d7e753c02a0ae325d22034cbf67d1ad1..b4f43d12fbbb20feddda1859cd905cfb5d93db06 100644
--- a/ios/chrome/browser/web/browsing_prevent_default_egtest.mm
+++ b/ios/chrome/browser/web/browsing_prevent_default_egtest.mm
@@ -97,17 +97,7 @@ class ScopedBlockPopupsPref {
// Tap on the test link and wait for the page to display "Click done", as an
// indicator that the element was tapped.
chrome_test_util::TapWebViewElementWithId(linkID);
- [[GREYCondition
- conditionWithName:@"Waiting for webview to display 'Click done'."
- block:^BOOL {
- id<GREYMatcher> webViewMatcher =
- chrome_test_util::WebViewContainingText("Click done");
- NSError* error = nil;
- [[EarlGrey selectElementWithMatcher:webViewMatcher]
- assertWithMatcher:grey_notNil()
- error:&error];
- return error == nil;
- }] waitWithTimeout:kConditionTimeout];
+ [ChromeEarlGrey waitForWebViewContainingText:"Click done"];
// Check that no navigation occurred and no new tabs were opened.
chrome_test_util::AssertMainTabCount(1U);
@@ -149,19 +139,7 @@ class ScopedBlockPopupsPref {
const std::string linkID =
"webScenarioBrowsingLinkPreventDefaultOverridesWindowOpen";
chrome_test_util::TapWebViewElementWithId(linkID);
-
- // Stall a bit to make sure the webview doesn't do anything asynchronously.
- [[GREYCondition
- conditionWithName:@"Waiting for webview to display 'Click done'."
- block:^BOOL {
- id<GREYMatcher> webViewMatcher =
- chrome_test_util::WebViewContainingText("Click done");
- NSError* error = nil;
- [[EarlGrey selectElementWithMatcher:webViewMatcher]
- assertWithMatcher:grey_notNil()
- error:&error];
- return error == nil;
- }] waitWithTimeout:kConditionTimeout];
+ [ChromeEarlGrey waitForWebViewContainingText:"Click done"];
// Check that the tab navigated to about:blank and no new tabs were opened.
[[GREYCondition
« no previous file with comments | « ios/chrome/browser/web/browsing_egtest.mm ('k') | ios/chrome/browser/web/cache_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698