| 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 7e4817ae7cae33af8f2478d3a2e2150a435735ab..0b535f9d69ddf9ac9cdc5acdcff4337c4908c3c4 100644
|
| --- a/ios/chrome/browser/web/browsing_egtest.mm
|
| +++ b/ios/chrome/browser/web/browsing_egtest.mm
|
| @@ -36,7 +36,6 @@
|
| #include "url/gurl.h"
|
|
|
| using chrome_test_util::OmniboxText;
|
| -using chrome_test_util::WebViewContainingText;
|
|
|
| namespace {
|
|
|
| @@ -142,18 +141,15 @@ id<GREYMatcher> GoButtonMatcher() {
|
|
|
| GURL URL = ReloadResponseProvider::GetReloadTestUrl();
|
| [ChromeEarlGrey loadURL:URL];
|
| - std::string expectedBodyBeforeReload(
|
| +
|
| + NSString* expectedBodyBeforeReload = base::SysUTF8ToNSString(
|
| ReloadResponseProvider::GetResponseBody(0 /* request number */));
|
| - [[EarlGrey
|
| - selectElementWithMatcher:WebViewContainingText(expectedBodyBeforeReload)]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ChromeEarlGrey waitForWebViewContainingText:expectedBodyBeforeReload];
|
|
|
| [ChromeEarlGreyUI reload];
|
| - std::string expectedBodyAfterReload(
|
| + NSString* expectedBodyAfterReload = base::SysUTF8ToNSString(
|
| 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
|
| @@ -430,8 +426,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);
|
| @@ -537,8 +532,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.
|
| @@ -625,21 +619,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()];
|
| }
|
|
|