Chromium Code Reviews| 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..d3e9aa1382b6abda8e24316f2ce816d68dfcdd74 100644 |
| --- a/chrome/browser/extensions/web_view_browsertest.cc |
| +++ b/chrome/browser/extensions/web_view_browsertest.cc |
| @@ -352,8 +352,9 @@ 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_type, |
| + const std::string& test_name, |
| + const std::string& app_location) { |
| ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
| ExtensionTestMessageListener launched_listener("Launched", false); |
| LoadAndLaunchPlatformApp(app_location.c_str()); |
| @@ -363,12 +364,14 @@ 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( |
| + base::StringPrintf("Done%sTest.PASSED", test_type.c_str()), false); |
|
lazyboy
2013/06/22 04:29:15
Instead of sending test_type, i'd suggest passing
Fady Samuel
2013/06/25 15:46:12
Done.
|
| + done_listener.AlsoListenForFailureMessage( |
| + base::StringPrintf("Done%sTest.FAILED", test_type.c_str())); |
| EXPECT_TRUE(content::ExecuteScript( |
| embedder_web_contents, |
| - base::StringPrintf("runGeolocationTest('%s')", |
| + base::StringPrintf("run%sTest('%s')", |
| + test_type.c_str(), |
| test_name.c_str()))); |
| ASSERT_TRUE(done_listener.WaitUntilSatisfied()); |
| } |
| @@ -988,13 +991,13 @@ 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("Geolocation", "testDenyDenies", |
| + "web_view/geolocation/embedder_has_no_permission"); |
| } |
| IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPIEmbedderHasNoAccessDeny) { |
| - GeolocationTestHelper("testDenyDenies", |
| - "web_view/geolocation/embedder_has_no_permission"); |
| + TestHelper("Geolocation", "testDenyDenies", |
| + "web_view/geolocation/embedder_has_no_permission"); |
| } |
| // In following GeolocationAPIEmbedderHasAccess* tests, embedder (i.e. the |
| @@ -1008,21 +1011,21 @@ 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("Geolocation", "testAllow", |
| + "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("Geolocation", "testDeny", |
| + "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("Geolocation", "testMultipleBridgeIdAllow", |
| + "web_view/geolocation/embedder_has_permission"); |
| } |
| // Tests that |
| @@ -1034,6 +1037,10 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPICancelGeolocation) { |
| "platform_apps/web_view/geolocation/cancel_request")) << message_; |
| } |
| +IN_PROC_BROWSER_TEST_F(WebViewTest, Navigation) { |
| + TestHelper("Navigation", "testNavigation", "web_view/navigation"); |
| +} |
| + |
| IN_PROC_BROWSER_TEST_F(WebViewTest, ConsoleMessage) { |
| ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
| ASSERT_TRUE(RunPlatformAppTestWithArg( |