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/process/process.h" | 6 #include "base/process/process.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/apps/app_browsertest_util.h" | 10 #include "chrome/browser/apps/app_browsertest_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "media/base/media_switches.h" | 45 #include "media/base/media_switches.h" |
46 #include "net/test/embedded_test_server/embedded_test_server.h" | 46 #include "net/test/embedded_test_server/embedded_test_server.h" |
47 #include "net/test/embedded_test_server/http_request.h" | 47 #include "net/test/embedded_test_server/http_request.h" |
48 #include "net/test/embedded_test_server/http_response.h" | 48 #include "net/test/embedded_test_server/http_response.h" |
49 #include "ui/gfx/switches.h" | 49 #include "ui/gfx/switches.h" |
50 #include "ui/gl/gl_switches.h" | 50 #include "ui/gl/gl_switches.h" |
51 | 51 |
52 #if defined(ENABLE_PLUGINS) | 52 #if defined(ENABLE_PLUGINS) |
53 #include "content/public/browser/plugin_service.h" | 53 #include "content/public/browser/plugin_service.h" |
54 #include "content/public/common/webplugininfo.h" | 54 #include "content/public/common/webplugininfo.h" |
| 55 #include "content/public/test/ppapi_test_utils.h" |
55 #endif | 56 #endif |
56 | 57 |
57 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
58 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 59 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
59 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 60 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
60 #endif | 61 #endif |
61 | 62 |
62 // For fine-grained suppression on flaky tests. | 63 // For fine-grained suppression on flaky tests. |
63 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
64 #include "base/win/windows_version.h" | 65 #include "base/win/windows_version.h" |
(...skipping 14 matching lines...) Expand all Loading... |
79 using task_manager::browsertest_util::WaitForTaskManagerRows; | 80 using task_manager::browsertest_util::WaitForTaskManagerRows; |
80 using ui::MenuModel; | 81 using ui::MenuModel; |
81 | 82 |
82 namespace { | 83 namespace { |
83 const char kEmptyResponsePath[] = "/close-socket"; | 84 const char kEmptyResponsePath[] = "/close-socket"; |
84 const char kRedirectResponsePath[] = "/server-redirect"; | 85 const char kRedirectResponsePath[] = "/server-redirect"; |
85 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; | 86 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; |
86 const char kRedirectResponseFullPath[] = | 87 const char kRedirectResponseFullPath[] = |
87 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; | 88 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; |
88 | 89 |
89 // Platform-specific filename relative to the chrome executable. | |
90 #if defined(OS_WIN) | |
91 const wchar_t library_name[] = L"ppapi_tests.dll"; | |
92 #elif defined(OS_MACOSX) | |
93 const char library_name[] = "ppapi_tests.plugin"; | |
94 #elif defined(OS_POSIX) | |
95 const char library_name[] = "libppapi_tests.so"; | |
96 #endif | |
97 | |
98 class EmptyHttpResponse : public net::test_server::HttpResponse { | 90 class EmptyHttpResponse : public net::test_server::HttpResponse { |
99 public: | 91 public: |
100 std::string ToResponseString() const override { return std::string(); } | 92 std::string ToResponseString() const override { return std::string(); } |
101 }; | 93 }; |
102 | 94 |
103 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { | 95 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { |
104 public: | 96 public: |
105 TestInterstitialPageDelegate() { | 97 TestInterstitialPageDelegate() { |
106 } | 98 } |
107 ~TestInterstitialPageDelegate() override {} | 99 ~TestInterstitialPageDelegate() override {} |
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2576 "platform_apps/web_view/extension_api/content_settings")); | 2568 "platform_apps/web_view/extension_api/content_settings")); |
2577 ASSERT_TRUE(content_settings_extension); | 2569 ASSERT_TRUE(content_settings_extension); |
2578 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); | 2570 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); |
2579 } | 2571 } |
2580 | 2572 |
2581 #if defined(ENABLE_PLUGINS) | 2573 #if defined(ENABLE_PLUGINS) |
2582 class WebViewPluginTest : public WebViewTest { | 2574 class WebViewPluginTest : public WebViewTest { |
2583 protected: | 2575 protected: |
2584 void SetUpCommandLine(base::CommandLine* command_line) override { | 2576 void SetUpCommandLine(base::CommandLine* command_line) override { |
2585 WebViewTest::SetUpCommandLine(command_line); | 2577 WebViewTest::SetUpCommandLine(command_line); |
2586 | 2578 ppapi::RegisterTestPlugin(command_line); |
2587 // Append the switch to register the pepper plugin. | |
2588 // library name = <out dir>/<test_name>.<library_extension> | |
2589 // MIME type = application/x-ppapi-<test_name> | |
2590 base::FilePath plugin_lib = GetPluginPath(); | |
2591 EXPECT_TRUE(base::PathExists(plugin_lib)); | |
2592 base::FilePath::StringType pepper_plugin = plugin_lib.value(); | |
2593 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | |
2594 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | |
2595 pepper_plugin); | |
2596 } | |
2597 | |
2598 base::FilePath GetPluginPath() const { | |
2599 base::FilePath plugin_dir; | |
2600 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); | |
2601 return plugin_dir.Append(library_name); | |
2602 } | 2579 } |
2603 }; | 2580 }; |
2604 | 2581 |
2605 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { | 2582 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { |
2606 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); | 2583 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); |
2607 } | 2584 } |
2608 | 2585 |
2609 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) { | 2586 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) { |
2610 const char kTestMimeType[] = "application/pdf"; | 2587 const char kTestMimeType[] = "application/pdf"; |
2611 const char kTestFileType[] = "pdf"; | 2588 const char kTestFileType[] = "pdf"; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { | 2742 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { |
2766 LoadAppWithGuest("web_view/simple"); | 2743 LoadAppWithGuest("web_view/simple"); |
2767 | 2744 |
2768 ASSERT_TRUE(!!GetGuestWebContents()); | 2745 ASSERT_TRUE(!!GetGuestWebContents()); |
2769 extensions::WebViewGuest* guest = | 2746 extensions::WebViewGuest* guest = |
2770 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); | 2747 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); |
2771 ASSERT_TRUE(guest->allow_transparency()); | 2748 ASSERT_TRUE(guest->allow_transparency()); |
2772 ASSERT_TRUE(guest->allow_scaling()); | 2749 ASSERT_TRUE(guest->allow_scaling()); |
2773 } | 2750 } |
2774 | 2751 |
OLD | NEW |