OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 11 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
16 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/test/browser_test_utils.h" | 18 #include "content/public/test/browser_test_utils.h" |
19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
20 | 20 |
21 using content::NavigationController; | 21 using content::NavigationController; |
22 using content::WebContents; | 22 using content::WebContents; |
23 using extensions::Extension; | 23 using extensions::Extension; |
24 | 24 |
| 25 #if defined(OS_WIN) && !defined(NDEBUG) |
| 26 // http://crbug.com/123851 : test flakily fails on win debug. |
| 27 #define MAYBE_PluginLoadUnload DISABLED_PluginLoadUnload |
| 28 #else |
| 29 #define MAYBE_PluginLoadUnload PluginLoadUnload |
| 30 #endif |
| 31 |
25 // Tests that a renderer's plugin list is properly updated when we load and | 32 // Tests that a renderer's plugin list is properly updated when we load and |
26 // unload an extension that contains a plugin. | 33 // unload an extension that contains a plugin. |
27 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PluginLoadUnload) { | 34 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { |
28 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize, | 35 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize, |
29 true); | 36 true); |
30 | 37 |
31 FilePath extension_dir = | 38 FilePath extension_dir = |
32 test_data_dir_.AppendASCII("uitest").AppendASCII("plugins"); | 39 test_data_dir_.AppendASCII("uitest").AppendASCII("plugins"); |
33 | 40 |
34 ui_test_utils::NavigateToURL(browser(), | 41 ui_test_utils::NavigateToURL(browser(), |
35 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); | 42 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); |
36 WebContents* tab = chrome::GetActiveWebContents(browser()); | 43 WebContents* tab = chrome::GetActiveWebContents(browser()); |
37 | 44 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 EXPECT_TRUE(result); | 141 EXPECT_TRUE(result); |
135 #endif | 142 #endif |
136 | 143 |
137 // Now load it through a file URL. The plugin should not load. | 144 // Now load it through a file URL. The plugin should not load. |
138 ui_test_utils::NavigateToURL(browser(), | 145 ui_test_utils::NavigateToURL(browser(), |
139 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); | 146 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); |
140 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 147 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
141 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); | 148 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); |
142 EXPECT_FALSE(result); | 149 EXPECT_FALSE(result); |
143 } | 150 } |
OLD | NEW |