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

Unified Diff: ios/web/shell/test/web_shell_navigation_egtest.mm

Issue 2102773002: Add eg test for webScenarioBrowsingUnsupportedSchema. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6cdbf26600ba4568bd141a7ef814bd289211d14d 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 a link with unsupported URL scheme.
+- (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 "
+ "navigation!'));"
baxley 2016/06/28 14:21:06 super-nit: I think this should be indented more. E
+ " }"
+ "</script>"
+ "<a href='aaa://unsupported' id='link' "
+ "onclick='printMsg();'>unsupportedScheme</a>";
+ 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 navigation!")]
+ assertWithMatcher:grey_notNil()];
+}
+
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698