| Index: ios/web/shell/test/navigation_egtest.mm
|
| diff --git a/ios/web/shell/test/navigation_egtest.mm b/ios/web/shell/test/navigation_egtest.mm
|
| index 1698e4121de59a29ed54fe12eb1d45666e9b6492..ab5d705b9e6ee12620dee842e9423adc14605ad6 100644
|
| --- a/ios/web/shell/test/navigation_egtest.mm
|
| +++ b/ios/web/shell/test/navigation_egtest.mm
|
| @@ -49,40 +49,36 @@
|
| // Create map of canned responses and set up the test HTML server.
|
| std::map<GURL, std::string> responses;
|
| const GURL URL1 = web::test::HttpServer::MakeUrl("http://firstURL");
|
| - std::string response1 = "Test Page 1";
|
| - responses[URL1] = response1;
|
| + NSString* response1 = @"Test Page 1";
|
| + responses[URL1] = base::SysNSStringToUTF8(response1);
|
|
|
| const GURL URL2 = web::test::HttpServer::MakeUrl("http://secondURL");
|
| - std::string response2 = "Test Page 2";
|
| - responses[URL2] = response2;
|
| + NSString* response2 = @"Test Page 2";
|
| + responses[URL2] = base::SysNSStringToUTF8(response2);
|
|
|
| web::test::SetUpSimpleHttpServer(responses);
|
|
|
| [ShellEarlGrey loadURL:URL1];
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL1.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey selectElementWithMatcher:web::WebViewContainingText(response1)]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:response1];
|
|
|
| [ShellEarlGrey loadURL:URL2];
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL2.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey selectElementWithMatcher:web::WebViewContainingText(response2)]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:response2];
|
|
|
| [[EarlGrey selectElementWithMatcher:web::BackButton()]
|
| performAction:grey_tap()];
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL1.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey selectElementWithMatcher:web::WebViewContainingText(response1)]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:response1];
|
|
|
| [[EarlGrey selectElementWithMatcher:web::ForwardButton()]
|
| performAction:grey_tap()];
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL2.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey selectElementWithMatcher:web::WebViewContainingText(response2)]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:response2];
|
| }
|
|
|
| // Tests back and forward navigation where a fragment link is tapped.
|
| @@ -143,9 +139,7 @@
|
|
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey
|
| - selectElementWithMatcher:web::WebViewContainingText("Default prevented!")]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:@"Default prevented!"];
|
| }
|
|
|
| // Tests tapping on a link with unsupported URL scheme.
|
| @@ -175,9 +169,7 @@
|
|
|
| [[EarlGrey selectElementWithMatcher:web::AddressFieldText(URL.spec())]
|
| assertWithMatcher:grey_notNil()];
|
| - [[EarlGrey
|
| - selectElementWithMatcher:web::WebViewContainingText("No navigation!")]
|
| - assertWithMatcher:grey_notNil()];
|
| + [ShellEarlGrey waitForWebViewContainingText:@"No navigation!"];
|
| }
|
|
|
| @end
|
|
|