Chromium Code Reviews| Index: ios/web/shell/test/web_shell_navigation_egtest.mm |
| diff --git a/ios/web/shell/test/web_shell_navigation_egtest.mm b/ios/web/shell/test/web_shell_navigation_egtest.mm |
| index 4575254ba9c3e17cc6cbd7ba7ade45dcd81a8cf2..a2f731e25b662588471399f94bed392e4b9a0099 100644 |
| --- a/ios/web/shell/test/web_shell_navigation_egtest.mm |
| +++ b/ios/web/shell/test/web_shell_navigation_egtest.mm |
| @@ -171,4 +171,36 @@ |
| assertWithMatcher:grey_notNil()]; |
| } |
| +// Tests tapping on an unsupported URI Scheme. |
|
Eugene But (OOO till 7-30)
2016/06/27 21:13:28
s/an unsupported URI Scheme/a link with unsupporte
|
| +- (void)testNavigationUnsupportedSchema { |
| + // Create map of canned responses and set up the test HTML server. |
| + std::map<GURL, std::string> responses; |
| + const GURL URL = |
| + web::test::HttpServer::MakeUrl("http://urlWithUnsupportedSchemeLink"); |
| + const char pageHTML[] = |
| + "<script>" |
| + " function printMsg() {" |
| + " document.body.appendChild(document.createTextNode('No " |
| + "redirection!'));" |
|
Eugene But (OOO till 7-30)
2016/06/27 21:13:28
s/redirection/navigation
|
| + " }" |
| + "</script>" |
| + "<a href='aaa://unsupported' id='link' " |
| + "onclick='printMsg();'>redirectLink</a>"; |
|
Eugene But (OOO till 7-30)
2016/06/27 21:13:28
s/redirectLink/unsupportedScheme this link does no
|
| + responses[URL] = pageHTML; |
| + |
| + web::test::SetUpSimpleHttpServer(responses); |
| + |
| + web::shell_test_util::LoadUrl(URL); |
| + [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL.spec())] |
| + assertWithMatcher:grey_notNil()]; |
| + |
| + web::shell_test_util::TapWebViewElementWithId("link"); |
| + |
| + [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL.spec())] |
| + assertWithMatcher:grey_notNil()]; |
| + [[EarlGrey |
| + selectElementWithMatcher:web::webViewContainingText("No redirection!")] |
| + assertWithMatcher:grey_notNil()]; |
| +} |
| + |
| @end |