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

Unified Diff: chrome/browser/extensions/web_view_browsertest.cc

Issue 17447005: <webview>: Move back, forward, canGoBack, canGoForward, go from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filter_listener
Patch Set: Created 7 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: chrome/browser/extensions/web_view_browsertest.cc
diff --git a/chrome/browser/extensions/web_view_browsertest.cc b/chrome/browser/extensions/web_view_browsertest.cc
index bfe49c3c4b49d9af4ff769617e8e036b146a5f07..ba7dba23399f3c28306ba806794cb7e1dd5547df 100644
--- a/chrome/browser/extensions/web_view_browsertest.cc
+++ b/chrome/browser/extensions/web_view_browsertest.cc
@@ -352,8 +352,10 @@ class WebViewTest : public extensions::PlatformAppBrowserTest {
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
- void GeolocationTestHelper(const std::string& test_name,
- const std::string& app_location) {
+ void TestHelper(const std::string& test_name,
+ const std::string& test_passed_msg,
+ const std::string& test_failed_msg,
+ const std::string& app_location) {
ASSERT_TRUE(StartTestServer()); // For serving guest pages.
ExtensionTestMessageListener launched_listener("Launched", false);
LoadAndLaunchPlatformApp(app_location.c_str());
@@ -363,13 +365,11 @@ class WebViewTest : public extensions::PlatformAppBrowserTest {
GetFirstShellWindowWebContents();
ASSERT_TRUE(embedder_web_contents);
- ExtensionTestMessageListener done_listener("DoneGeolocationTest.PASSED",
- false);
- done_listener.AlsoListenForFailureMessage("DoneGeolocationTest.FAILED");
+ ExtensionTestMessageListener done_listener(test_passed_msg, false);
+ done_listener.AlsoListenForFailureMessage(test_failed_msg);
EXPECT_TRUE(content::ExecuteScript(
embedder_web_contents,
- base::StringPrintf("runGeolocationTest('%s')",
- test_name.c_str())));
+ base::StringPrintf("runTest('%s')", test_name.c_str())));
ASSERT_TRUE(done_listener.WaitUntilSatisfied());
}
@@ -988,13 +988,17 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, TearDownTest) {
// No matter what the API does, geolocation permission would be denied.
// Note that the test name prefix must be "GeolocationAPI".
IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasNoAccessAllow) {
- GeolocationTestHelper("testDenyDenies",
- "web_view/geolocation/embedder_has_no_permission");
+ TestHelper("testDenyDenies",
+ "DoneGeolocationTest.PASSED",
+ "DoneGeolocationTest.FAILED",
+ "web_view/geolocation/embedder_has_no_permission");
}
IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasNoAccessDeny) {
- GeolocationTestHelper("testDenyDenies",
- "web_view/geolocation/embedder_has_no_permission");
+ TestHelper("testDenyDenies",
+ "DoneGeolocationTest.PASSED",
+ "DoneGeolocationTest.FAILED",
+ "web_view/geolocation/embedder_has_no_permission");
}
// In following GeolocationAPIEmbedderHasAccess* tests, embedder (i.e. the
@@ -1008,21 +1012,27 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasNoAccessDeny) {
// the tests become flaky.
// GeolocationAPI* test 1 of 3.
IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasAccessAllow) {
- GeolocationTestHelper("testAllow",
- "web_view/geolocation/embedder_has_permission");
+ TestHelper("testAllow",
+ "DoneGeolocationTest.PASSED",
+ "DoneGeolocationTest.FAILED",
+ "web_view/geolocation/embedder_has_permission");
}
// GeolocationAPI* test 2 of 3.
IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasAccessDeny) {
- GeolocationTestHelper("testDeny",
- "web_view/geolocation/embedder_has_permission");
+ TestHelper("testDeny",
+ "DoneGeolocationTest.PASSED",
+ "DoneGeolocationTest.FAILED",
+ "web_view/geolocation/embedder_has_permission");
}
// GeolocationAPI* test 3 of 3.
IN_PROC_BROWSER_TEST_F(WebViewTest,
GeolocationAPIEmbedderHasAccessMultipleBridgeIdAllow) {
- GeolocationTestHelper("testMultipleBridgeIdAllow",
- "web_view/geolocation/embedder_has_permission");
+ TestHelper("testMultipleBridgeIdAllow",
+ "DoneGeolocationTest.PASSED",
+ "DoneGeolocationTest.FAILED",
+ "web_view/geolocation/embedder_has_permission");
}
// Tests that
@@ -1034,6 +1044,13 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPICancelGeolocation) {
"platform_apps/web_view/geolocation/cancel_request")) << message_;
}
+IN_PROC_BROWSER_TEST_F(WebViewTest, Navigation) {
+ TestHelper("testNavigation",
+ "DoneNavigationTest.PASSED",
+ "DoneNavigationTest.FAILED",
+ "web_view/navigation");
+}
+
IN_PROC_BROWSER_TEST_F(WebViewTest, ConsoleMessage) {
ASSERT_TRUE(StartTestServer()); // For serving guest pages.
ASSERT_TRUE(RunPlatformAppTestWithArg(
« no previous file with comments | « chrome/browser/extensions/extension_function_histogram_value.h ('k') | chrome/browser/webview/webview_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698