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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "media/base/media_switches.h" | 44 #include "media/base/media_switches.h" |
45 #include "net/test/embedded_test_server/embedded_test_server.h" | 45 #include "net/test/embedded_test_server/embedded_test_server.h" |
46 #include "net/test/embedded_test_server/http_request.h" | 46 #include "net/test/embedded_test_server/http_request.h" |
47 #include "net/test/embedded_test_server/http_response.h" | 47 #include "net/test/embedded_test_server/http_response.h" |
48 #include "ui/gfx/switches.h" | 48 #include "ui/gfx/switches.h" |
49 #include "ui/gl/gl_switches.h" | 49 #include "ui/gl/gl_switches.h" |
50 | 50 |
51 #if defined(ENABLE_PLUGINS) | 51 #if defined(ENABLE_PLUGINS) |
52 #include "content/public/browser/plugin_service.h" | 52 #include "content/public/browser/plugin_service.h" |
53 #include "content/public/common/webplugininfo.h" | 53 #include "content/public/common/webplugininfo.h" |
| 54 #include "content/public/test/ppapi_test_utils.h" |
54 #endif | 55 #endif |
55 | 56 |
56 #if defined(OS_CHROMEOS) | 57 #if defined(OS_CHROMEOS) |
57 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 58 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
58 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 59 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
59 #endif | 60 #endif |
60 | 61 |
61 // For fine-grained suppression on flaky tests. | 62 // For fine-grained suppression on flaky tests. |
62 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
63 #include "base/win/windows_version.h" | 64 #include "base/win/windows_version.h" |
(...skipping 14 matching lines...) Expand all Loading... |
78 using task_manager::browsertest_util::WaitForTaskManagerRows; | 79 using task_manager::browsertest_util::WaitForTaskManagerRows; |
79 using ui::MenuModel; | 80 using ui::MenuModel; |
80 | 81 |
81 namespace { | 82 namespace { |
82 const char kEmptyResponsePath[] = "/close-socket"; | 83 const char kEmptyResponsePath[] = "/close-socket"; |
83 const char kRedirectResponsePath[] = "/server-redirect"; | 84 const char kRedirectResponsePath[] = "/server-redirect"; |
84 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; | 85 const char kUserAgentRedirectResponsePath[] = "/detect-user-agent"; |
85 const char kRedirectResponseFullPath[] = | 86 const char kRedirectResponseFullPath[] = |
86 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; | 87 "/extensions/platform_apps/web_view/shim/guest_redirect.html"; |
87 | 88 |
88 // Platform-specific filename relative to the chrome executable. | |
89 #if defined(OS_WIN) | |
90 const wchar_t library_name[] = L"ppapi_tests.dll"; | |
91 #elif defined(OS_MACOSX) | |
92 const char library_name[] = "ppapi_tests.plugin"; | |
93 #elif defined(OS_POSIX) | |
94 const char library_name[] = "libppapi_tests.so"; | |
95 #endif | |
96 | |
97 class EmptyHttpResponse : public net::test_server::HttpResponse { | 89 class EmptyHttpResponse : public net::test_server::HttpResponse { |
98 public: | 90 public: |
99 std::string ToResponseString() const override { return std::string(); } | 91 std::string ToResponseString() const override { return std::string(); } |
100 }; | 92 }; |
101 | 93 |
102 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { | 94 class TestInterstitialPageDelegate : public content::InterstitialPageDelegate { |
103 public: | 95 public: |
104 TestInterstitialPageDelegate() { | 96 TestInterstitialPageDelegate() { |
105 } | 97 } |
106 ~TestInterstitialPageDelegate() override {} | 98 ~TestInterstitialPageDelegate() override {} |
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 "platform_apps/web_view/extension_api/content_settings")); | 2538 "platform_apps/web_view/extension_api/content_settings")); |
2547 ASSERT_TRUE(content_settings_extension); | 2539 ASSERT_TRUE(content_settings_extension); |
2548 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); | 2540 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); |
2549 } | 2541 } |
2550 | 2542 |
2551 #if defined(ENABLE_PLUGINS) | 2543 #if defined(ENABLE_PLUGINS) |
2552 class WebViewPluginTest : public WebViewTest { | 2544 class WebViewPluginTest : public WebViewTest { |
2553 protected: | 2545 protected: |
2554 void SetUpCommandLine(base::CommandLine* command_line) override { | 2546 void SetUpCommandLine(base::CommandLine* command_line) override { |
2555 WebViewTest::SetUpCommandLine(command_line); | 2547 WebViewTest::SetUpCommandLine(command_line); |
2556 | 2548 ppapi::RegisterTestLibrary(command_line); |
2557 // Append the switch to register the pepper plugin. | |
2558 // library name = <out dir>/<test_name>.<library_extension> | |
2559 // MIME type = application/x-ppapi-<test_name> | |
2560 base::FilePath plugin_lib = GetPluginPath(); | |
2561 EXPECT_TRUE(base::PathExists(plugin_lib)); | |
2562 base::FilePath::StringType pepper_plugin = plugin_lib.value(); | |
2563 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | |
2564 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | |
2565 pepper_plugin); | |
2566 } | |
2567 | |
2568 base::FilePath GetPluginPath() const { | |
2569 base::FilePath plugin_dir; | |
2570 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); | |
2571 return plugin_dir.Append(library_name); | |
2572 } | 2549 } |
2573 }; | 2550 }; |
2574 | 2551 |
2575 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { | 2552 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginEvent) { |
2576 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); | 2553 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); |
2577 } | 2554 } |
2578 | 2555 |
2579 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) { | 2556 IN_PROC_BROWSER_TEST_F(WebViewPluginTest, TestLoadPluginInternalResource) { |
2580 const char kTestMimeType[] = "application/pdf"; | 2557 const char kTestMimeType[] = "application/pdf"; |
2581 const char kTestFileType[] = "pdf"; | 2558 const char kTestFileType[] = "pdf"; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { | 2712 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { |
2736 LoadAppWithGuest("web_view/simple"); | 2713 LoadAppWithGuest("web_view/simple"); |
2737 | 2714 |
2738 ASSERT_TRUE(!!GetGuestWebContents()); | 2715 ASSERT_TRUE(!!GetGuestWebContents()); |
2739 extensions::WebViewGuest* guest = | 2716 extensions::WebViewGuest* guest = |
2740 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); | 2717 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); |
2741 ASSERT_TRUE(guest->allow_transparency()); | 2718 ASSERT_TRUE(guest->allow_transparency()); |
2742 ASSERT_TRUE(guest->allow_scaling()); | 2719 ASSERT_TRUE(guest->allow_scaling()); |
2743 } | 2720 } |
2744 | 2721 |
OLD | NEW |