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

Unified Diff: ios/chrome/browser/web/browsing_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
Index: ios/chrome/browser/web/browsing_egtest.mm
diff --git a/ios/chrome/browser/web/browsing_egtest.mm b/ios/chrome/browser/web/browsing_egtest.mm
index 47a8fcab2da945ccf9bd75189d11dd37fa3729cf..ac51f9bc840fb67d3533341e4f40865f76fa4d99 100644
--- a/ios/chrome/browser/web/browsing_egtest.mm
+++ b/ios/chrome/browser/web/browsing_egtest.mm
@@ -40,7 +40,6 @@
#endif
using chrome_test_util::OmniboxText;
-using chrome_test_util::WebViewContainingText;
namespace {
@@ -148,16 +147,12 @@ id<GREYMatcher> GoButtonMatcher() {
[ChromeEarlGrey loadURL:URL];
std::string expectedBodyBeforeReload(
ReloadResponseProvider::GetResponseBody(0 /* request number */));
- [[EarlGrey
- selectElementWithMatcher:WebViewContainingText(expectedBodyBeforeReload)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:expectedBodyBeforeReload];
[ChromeEarlGreyUI reload];
std::string expectedBodyAfterReload(
ReloadResponseProvider::GetResponseBody(1 /* request_number */));
- [[EarlGrey
- selectElementWithMatcher:WebViewContainingText(expectedBodyAfterReload)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:expectedBodyAfterReload];
}
// Tests that a tab's title is based on the URL when no other information is
@@ -434,8 +429,7 @@ id<GREYMatcher> GoButtonMatcher() {
// onclick event.
[[EarlGrey selectElementWithMatcher:OmniboxText("chrome://version")]
assertWithMatcher:grey_nil()];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText("Hello world!")]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:"Hello world!"];
// Verify that no new tabs were open which could load chrome://version.
chrome_test_util::AssertMainTabCount(1U);
@@ -546,8 +540,7 @@ id<GREYMatcher> GoButtonMatcher() {
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Go")]
performAction:grey_tap()];
- id<GREYMatcher> webView = chrome_test_util::WebViewContainingText("foo");
- [[EarlGrey selectElementWithMatcher:webView] assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:"foo"];
// Verify that the JavaScript did not affect history by going back and then
// forward again.
@@ -639,21 +632,18 @@ id<GREYMatcher> GoButtonMatcher() {
// Open the URL, focus the textfield,and submit via keyboard.
[ChromeEarlGrey loadURL:URL];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText("hello!")]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:"hello!"];
[self submitFormUsingKeyboardGoButtonWithInputID:"textfield"];
// Verify that the browser navigates to the expected URL.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText("baz!")]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:"baz!"];
[[EarlGrey selectElementWithMatcher:OmniboxText(destinationURL.GetContent())]
assertWithMatcher:grey_notNil()];
// Go back and verify that the browser navigates to the original URL.
[self goBack];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText("hello!")]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:"hello!"];
[[EarlGrey selectElementWithMatcher:OmniboxText(URL.GetContent())]
assertWithMatcher:grey_notNil()];
}
« no previous file with comments | « ios/chrome/browser/ui/webui/web_ui_egtest.mm ('k') | ios/chrome/browser/web/browsing_prevent_default_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698