OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 extensions::PlatformAppBrowserTest::SetUpOnMainThread(); | 317 extensions::PlatformAppBrowserTest::SetUpOnMainThread(); |
318 const testing::TestInfo* const test_info = | 318 const testing::TestInfo* const test_info = |
319 testing::UnitTest::GetInstance()->current_test_info(); | 319 testing::UnitTest::GetInstance()->current_test_info(); |
320 // Mock out geolocation for geolocation specific tests. | 320 // Mock out geolocation for geolocation specific tests. |
321 if (!strncmp(test_info->name(), "GeolocationAPI", | 321 if (!strncmp(test_info->name(), "GeolocationAPI", |
322 strlen("GeolocationAPI"))) { | 322 strlen("GeolocationAPI"))) { |
323 ui_test_utils::OverrideGeolocation(10, 20); | 323 ui_test_utils::OverrideGeolocation(10, 20); |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 void SetUpCommandLine(CommandLine* command_line) override { | 327 void SetUpCommandLine(base::CommandLine* command_line) override { |
328 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 328 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
329 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 329 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
330 | 330 |
331 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | 331 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
332 } | 332 } |
333 | 333 |
334 // This method is responsible for initializing a packaged app, which contains | 334 // This method is responsible for initializing a packaged app, which contains |
335 // multiple webview tags. The tags have different partition identifiers and | 335 // multiple webview tags. The tags have different partition identifiers and |
336 // their WebContent objects are returned as output. The method also verifies | 336 // their WebContent objects are returned as output. The method also verifies |
337 // the expected process allocation and storage partition assignment. | 337 // the expected process allocation and storage partition assignment. |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 fake_speech_recognition_manager_; | 736 fake_speech_recognition_manager_; |
737 | 737 |
738 extensions::TestGuestViewManagerFactory factory_; | 738 extensions::TestGuestViewManagerFactory factory_; |
739 // Note that these are only set if you launch app using LoadAppWithGuest(). | 739 // Note that these are only set if you launch app using LoadAppWithGuest(). |
740 content::WebContents* guest_web_contents_; | 740 content::WebContents* guest_web_contents_; |
741 content::WebContents* embedder_web_contents_; | 741 content::WebContents* embedder_web_contents_; |
742 }; | 742 }; |
743 | 743 |
744 class WebViewDPITest : public WebViewTest { | 744 class WebViewDPITest : public WebViewTest { |
745 protected: | 745 protected: |
746 void SetUpCommandLine(CommandLine* command_line) override { | 746 void SetUpCommandLine(base::CommandLine* command_line) override { |
747 WebViewTest::SetUpCommandLine(command_line); | 747 WebViewTest::SetUpCommandLine(command_line); |
748 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 748 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
749 base::StringPrintf("%f", scale())); | 749 base::StringPrintf("%f", scale())); |
750 } | 750 } |
751 | 751 |
752 static float scale() { return 2.0f; } | 752 static float scale() { return 2.0f; } |
753 }; | 753 }; |
754 | 754 |
755 // This test verifies that hiding the guest triggers WebContents::WasHidden(). | 755 // This test verifies that hiding the guest triggers WebContents::WasHidden(). |
756 IN_PROC_BROWSER_TEST_F(WebViewTest, GuestVisibilityChanged) { | 756 IN_PROC_BROWSER_TEST_F(WebViewTest, GuestVisibilityChanged) { |
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2287 LoadExtension( | 2287 LoadExtension( |
2288 test_data_dir_.AppendASCII( | 2288 test_data_dir_.AppendASCII( |
2289 "platform_apps/web_view/extension_api/content_settings")); | 2289 "platform_apps/web_view/extension_api/content_settings")); |
2290 ASSERT_TRUE(content_settings_extension); | 2290 ASSERT_TRUE(content_settings_extension); |
2291 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); | 2291 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); |
2292 } | 2292 } |
2293 | 2293 |
2294 #if defined(ENABLE_PLUGINS) | 2294 #if defined(ENABLE_PLUGINS) |
2295 class WebViewPluginTest : public WebViewTest { | 2295 class WebViewPluginTest : public WebViewTest { |
2296 protected: | 2296 protected: |
2297 void SetUpCommandLine(CommandLine* command_line) override { | 2297 void SetUpCommandLine(base::CommandLine* command_line) override { |
2298 WebViewTest::SetUpCommandLine(command_line); | 2298 WebViewTest::SetUpCommandLine(command_line); |
2299 | 2299 |
2300 // Append the switch to register the pepper plugin. | 2300 // Append the switch to register the pepper plugin. |
2301 // library name = <out dir>/<test_name>.<library_extension> | 2301 // library name = <out dir>/<test_name>.<library_extension> |
2302 // MIME type = application/x-ppapi-<test_name> | 2302 // MIME type = application/x-ppapi-<test_name> |
2303 base::FilePath plugin_lib = GetPluginPath(); | 2303 base::FilePath plugin_lib = GetPluginPath(); |
2304 EXPECT_TRUE(base::PathExists(plugin_lib)); | 2304 EXPECT_TRUE(base::PathExists(plugin_lib)); |
2305 base::FilePath::StringType pepper_plugin = plugin_lib.value(); | 2305 base::FilePath::StringType pepper_plugin = plugin_lib.value(); |
2306 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | 2306 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
2307 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | 2307 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 // http://crbug.com/403325 | 2449 // http://crbug.com/403325 |
2450 #define MAYBE_WebViewInBackgroundPage \ | 2450 #define MAYBE_WebViewInBackgroundPage \ |
2451 DISABLED_WebViewInBackgroundPage | 2451 DISABLED_WebViewInBackgroundPage |
2452 #else | 2452 #else |
2453 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage | 2453 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage |
2454 #endif | 2454 #endif |
2455 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { | 2455 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { |
2456 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) | 2456 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) |
2457 << message_; | 2457 << message_; |
2458 } | 2458 } |
OLD | NEW |