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" |
11 #include "chrome/browser/chrome_content_browser_client.h" | 11 #include "chrome/browser/chrome_content_browser_client.h" |
12 #include "chrome/browser/lifetime/application_lifetime.h" | 12 #include "chrome/browser/lifetime/application_lifetime.h" |
13 #include "chrome/browser/prerender/prerender_link_manager.h" | 13 #include "chrome/browser/prerender/prerender_link_manager.h" |
14 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 14 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 16 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
17 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 17 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
18 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 18 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_dialogs.h" | 20 #include "chrome/browser/ui/browser_dialogs.h" |
21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
22 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "components/content_settings/core/browser/host_content_settings_map.h" |
23 #include "content/public/browser/gpu_data_manager.h" | 24 #include "content/public/browser/gpu_data_manager.h" |
24 #include "content/public/browser/interstitial_page.h" | 25 #include "content/public/browser/interstitial_page.h" |
25 #include "content/public/browser/interstitial_page_delegate.h" | 26 #include "content/public/browser/interstitial_page_delegate.h" |
26 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
27 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
28 #include "content/public/browser/web_contents_delegate.h" | 29 #include "content/public/browser/web_contents_delegate.h" |
29 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
30 #include "content/public/test/browser_test_utils.h" | 31 #include "content/public/test/browser_test_utils.h" |
31 #include "content/public/test/fake_speech_recognition_manager.h" | 32 #include "content/public/test/fake_speech_recognition_manager.h" |
32 #include "content/public/test/test_renderer_host.h" | 33 #include "content/public/test/test_renderer_host.h" |
(...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2741 LoadAppWithGuest("web_view/inside_iframe"); | 2742 LoadAppWithGuest("web_view/inside_iframe"); |
2742 } | 2743 } |
2743 | 2744 |
2744 // <webview> screenshot capture fails with ubercomp. | 2745 // <webview> screenshot capture fails with ubercomp. |
2745 // See http://crbug.com/327035. | 2746 // See http://crbug.com/327035. |
2746 IN_PROC_BROWSER_TEST_F(WebViewCaptureTest, | 2747 IN_PROC_BROWSER_TEST_F(WebViewCaptureTest, |
2747 DISABLED_Shim_ScreenshotCapture) { | 2748 DISABLED_Shim_ScreenshotCapture) { |
2748 TestHelper("testScreenshotCapture", "web_view/shim", NO_TEST_SERVER); | 2749 TestHelper("testScreenshotCapture", "web_view/shim", NO_TEST_SERVER); |
2749 } | 2750 } |
2750 | 2751 |
| 2752 // Tests that browser process does not crash when loading plugin inside |
| 2753 // <webview> with content settings set to CONTENT_SETTING_BLOCK. |
| 2754 IN_PROC_BROWSER_TEST_F(WebViewTest, TestPlugin) { |
| 2755 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 2756 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); |
| 2757 TestHelper("testPlugin", "web_view/shim", NEEDS_TEST_SERVER); |
| 2758 } |
| 2759 |
2751 #if defined(OS_WIN) | 2760 #if defined(OS_WIN) |
2752 // Test is disabled on Windows because it times out often. | 2761 // Test is disabled on Windows because it times out often. |
2753 // http://crbug.com/403325 | 2762 // http://crbug.com/403325 |
2754 #define MAYBE_WebViewInBackgroundPage \ | 2763 #define MAYBE_WebViewInBackgroundPage \ |
2755 DISABLED_WebViewInBackgroundPage | 2764 DISABLED_WebViewInBackgroundPage |
2756 #else | 2765 #else |
2757 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage | 2766 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage |
2758 #endif | 2767 #endif |
2759 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { | 2768 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { |
2760 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) | 2769 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) |
2761 << message_; | 2770 << message_; |
2762 } | 2771 } |
2763 | 2772 |
2764 // This test verifies that the allowtransparency attribute properly propagates | 2773 // This test verifies that the allowtransparency attribute properly propagates |
2765 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { | 2774 IN_PROC_BROWSER_TEST_F(WebViewTest, AllowTransparencyAndAllowScalingPropagate) { |
2766 LoadAppWithGuest("web_view/simple"); | 2775 LoadAppWithGuest("web_view/simple"); |
2767 | 2776 |
2768 ASSERT_TRUE(!!GetGuestWebContents()); | 2777 ASSERT_TRUE(!!GetGuestWebContents()); |
2769 extensions::WebViewGuest* guest = | 2778 extensions::WebViewGuest* guest = |
2770 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); | 2779 extensions::WebViewGuest::FromWebContents(GetGuestWebContents()); |
2771 ASSERT_TRUE(guest->allow_transparency()); | 2780 ASSERT_TRUE(guest->allow_transparency()); |
2772 ASSERT_TRUE(guest->allow_scaling()); | 2781 ASSERT_TRUE(guest->allow_scaling()); |
2773 } | 2782 } |
2774 | 2783 |
OLD | NEW |