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

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

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: better formatting Created 3 years, 8 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
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 87a96c66b0aef4bd8482463d2de8972b3d7dbe26..6557b3620acde7b052efd78cb9ab31b4998e7a1d 100644
--- a/ios/chrome/browser/web/browsing_prevent_default_egtest.mm
+++ b/ios/chrome/browser/web/browsing_prevent_default_egtest.mm
@@ -93,17 +93,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);
@@ -145,19 +135,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

Powered by Google App Engine
This is Rietveld 408576698