| 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 <queue> | 5 #include <queue> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "extensions/browser/api/extensions_api_client.h" | 70 #include "extensions/browser/api/extensions_api_client.h" |
| 71 #include "extensions/browser/app_window/native_app_window.h" | 71 #include "extensions/browser/app_window/native_app_window.h" |
| 72 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 72 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 73 #include "extensions/common/extension.h" | 73 #include "extensions/common/extension.h" |
| 74 #include "extensions/common/extensions_client.h" | 74 #include "extensions/common/extensions_client.h" |
| 75 #include "extensions/test/extension_test_message_listener.h" | 75 #include "extensions/test/extension_test_message_listener.h" |
| 76 #include "media/base/media_switches.h" | 76 #include "media/base/media_switches.h" |
| 77 #include "net/test/embedded_test_server/embedded_test_server.h" | 77 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 78 #include "net/test/embedded_test_server/http_request.h" | 78 #include "net/test/embedded_test_server/http_request.h" |
| 79 #include "net/test/embedded_test_server/http_response.h" | 79 #include "net/test/embedded_test_server/http_response.h" |
| 80 #include "ppapi/features/features.h" |
| 80 #include "ui/aura/env.h" | 81 #include "ui/aura/env.h" |
| 81 #include "ui/aura/window.h" | 82 #include "ui/aura/window.h" |
| 82 #include "ui/compositor/compositor.h" | 83 #include "ui/compositor/compositor.h" |
| 83 #include "ui/compositor/compositor_observer.h" | 84 #include "ui/compositor/compositor_observer.h" |
| 84 #include "ui/display/display_switches.h" | 85 #include "ui/display/display_switches.h" |
| 85 #include "ui/events/event_switches.h" | 86 #include "ui/events/event_switches.h" |
| 86 #include "ui/events/gesture_detection/gesture_configuration.h" | 87 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 87 #include "ui/gl/gl_switches.h" | 88 #include "ui/gl/gl_switches.h" |
| 88 #include "ui/views/view.h" | 89 #include "ui/views/view.h" |
| 89 #include "ui/views/widget/widget.h" | 90 #include "ui/views/widget/widget.h" |
| 90 | 91 |
| 91 #if defined(ENABLE_PLUGINS) | 92 #if BUILDFLAG(ENABLE_PLUGINS) |
| 92 #include "content/public/browser/plugin_service.h" | 93 #include "content/public/browser/plugin_service.h" |
| 93 #include "content/public/common/webplugininfo.h" | 94 #include "content/public/common/webplugininfo.h" |
| 94 #include "content/public/test/ppapi_test_utils.h" | 95 #include "content/public/test/ppapi_test_utils.h" |
| 95 #endif | 96 #endif |
| 96 | 97 |
| 97 #if defined(OS_CHROMEOS) | 98 #if defined(OS_CHROMEOS) |
| 98 #include "ash/common/accessibility_types.h" | 99 #include "ash/common/accessibility_types.h" |
| 99 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 100 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 100 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 101 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
| 101 #endif | 102 #endif |
| (...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2979 IN_PROC_BROWSER_TEST_P(WebViewTest, NoContentSettingsAPI) { | 2980 IN_PROC_BROWSER_TEST_P(WebViewTest, NoContentSettingsAPI) { |
| 2980 // Load the extension. | 2981 // Load the extension. |
| 2981 const extensions::Extension* content_settings_extension = | 2982 const extensions::Extension* content_settings_extension = |
| 2982 LoadExtension( | 2983 LoadExtension( |
| 2983 test_data_dir_.AppendASCII( | 2984 test_data_dir_.AppendASCII( |
| 2984 "platform_apps/web_view/extension_api/content_settings")); | 2985 "platform_apps/web_view/extension_api/content_settings")); |
| 2985 ASSERT_TRUE(content_settings_extension); | 2986 ASSERT_TRUE(content_settings_extension); |
| 2986 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); | 2987 TestHelper("testPostMessageCommChannel", "web_view/shim", NO_TEST_SERVER); |
| 2987 } | 2988 } |
| 2988 | 2989 |
| 2989 #if defined(ENABLE_PLUGINS) | 2990 #if BUILDFLAG(ENABLE_PLUGINS) |
| 2990 class WebViewPluginTest : public WebViewTest { | 2991 class WebViewPluginTest : public WebViewTest { |
| 2991 protected: | 2992 protected: |
| 2992 void SetUpCommandLine(base::CommandLine* command_line) override { | 2993 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 2993 WebViewTest::SetUpCommandLine(command_line); | 2994 WebViewTest::SetUpCommandLine(command_line); |
| 2994 ASSERT_TRUE(ppapi::RegisterTestPlugin(command_line)); | 2995 ASSERT_TRUE(ppapi::RegisterTestPlugin(command_line)); |
| 2995 } | 2996 } |
| 2996 }; | 2997 }; |
| 2997 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewPluginTest, testing::Bool()); | 2998 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewPluginTest, testing::Bool()); |
| 2998 | 2999 |
| 2999 IN_PROC_BROWSER_TEST_P(WebViewPluginTest, TestLoadPluginEvent) { | 3000 IN_PROC_BROWSER_TEST_P(WebViewPluginTest, TestLoadPluginEvent) { |
| 3000 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); | 3001 TestHelper("testPluginLoadPermission", "web_view/shim", NO_TEST_SERVER); |
| 3001 } | 3002 } |
| 3002 | 3003 |
| 3003 IN_PROC_BROWSER_TEST_P(WebViewPluginTest, TestLoadPluginInternalResource) { | 3004 IN_PROC_BROWSER_TEST_P(WebViewPluginTest, TestLoadPluginInternalResource) { |
| 3004 const char kTestMimeType[] = "application/pdf"; | 3005 const char kTestMimeType[] = "application/pdf"; |
| 3005 const char kTestFileType[] = "pdf"; | 3006 const char kTestFileType[] = "pdf"; |
| 3006 content::WebPluginInfo plugin_info; | 3007 content::WebPluginInfo plugin_info; |
| 3007 plugin_info.type = content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS; | 3008 plugin_info.type = content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS; |
| 3008 plugin_info.mime_types.push_back( | 3009 plugin_info.mime_types.push_back( |
| 3009 content::WebPluginMimeType(kTestMimeType, kTestFileType, std::string())); | 3010 content::WebPluginMimeType(kTestMimeType, kTestFileType, std::string())); |
| 3010 content::PluginService::GetInstance()->RegisterInternalPlugin(plugin_info, | 3011 content::PluginService::GetInstance()->RegisterInternalPlugin(plugin_info, |
| 3011 true); | 3012 true); |
| 3012 | 3013 |
| 3013 TestHelper("testPluginLoadInternalResource", "web_view/shim", NO_TEST_SERVER); | 3014 TestHelper("testPluginLoadInternalResource", "web_view/shim", NO_TEST_SERVER); |
| 3014 } | 3015 } |
| 3015 #endif // defined(ENABLE_PLUGINS) | 3016 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| 3016 | 3017 |
| 3017 class WebViewCaptureTest : public WebViewTest { | 3018 class WebViewCaptureTest : public WebViewTest { |
| 3018 public: | 3019 public: |
| 3019 WebViewCaptureTest() {} | 3020 WebViewCaptureTest() {} |
| 3020 ~WebViewCaptureTest() override {} | 3021 ~WebViewCaptureTest() override {} |
| 3021 void SetUp() override { | 3022 void SetUp() override { |
| 3022 EnablePixelOutput(); | 3023 EnablePixelOutput(); |
| 3023 WebViewTest::SetUp(); | 3024 WebViewTest::SetUp(); |
| 3024 } | 3025 } |
| 3025 }; | 3026 }; |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3852 gfx::Point embedder_origin = | 3853 gfx::Point embedder_origin = |
| 3853 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3854 GetEmbedderWebContents()->GetContainerBounds().origin(); |
| 3854 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3855 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
| 3855 | 3856 |
| 3856 // Generate and send synthetic touch event. | 3857 // Generate and send synthetic touch event. |
| 3857 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3858 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 3858 guest_rect.CenterPoint()); | 3859 guest_rect.CenterPoint()); |
| 3859 EXPECT_TRUE(aura_webview->HasFocus()); | 3860 EXPECT_TRUE(aura_webview->HasFocus()); |
| 3860 } | 3861 } |
| 3861 #endif | 3862 #endif |
| OLD | NEW |