| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #elif defined(OS_WIN) && defined(ARCH_CPU_X86_64) | 124 #elif defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 125 // TODO(jschuh): Failing plugin tests. crbug.com/244653 | 125 // TODO(jschuh): Failing plugin tests. crbug.com/244653 |
| 126 #define MAYBE_PluginPrivate DISABLED_PluginPrivate | 126 #define MAYBE_PluginPrivate DISABLED_PluginPrivate |
| 127 #else | 127 #else |
| 128 #define MAYBE_PluginPrivate PluginPrivate | 128 #define MAYBE_PluginPrivate PluginPrivate |
| 129 #endif | 129 #endif |
| 130 // Tests that private extension plugins are only visible to the extension. | 130 // Tests that private extension plugins are only visible to the extension. |
| 131 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) { | 131 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) { |
| 132 #if defined(OS_WIN) && defined(USE_ASH) | 132 #if defined(OS_WIN) && defined(USE_ASH) |
| 133 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 133 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 134 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 134 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 135 switches::kAshBrowserTests)) |
| 135 return; | 136 return; |
| 136 #endif | 137 #endif |
| 137 | 138 |
| 138 if (!content::PluginService::GetInstance()->NPAPIPluginsSupported()) | 139 if (!content::PluginService::GetInstance()->NPAPIPluginsSupported()) |
| 139 return; | 140 return; |
| 140 | 141 |
| 141 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize, | 142 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize, |
| 142 true); | 143 true); |
| 143 | 144 |
| 144 base::FilePath extension_dir = | 145 base::FilePath extension_dir = |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 EXPECT_TRUE(result); | 186 EXPECT_TRUE(result); |
| 186 #endif | 187 #endif |
| 187 | 188 |
| 188 // Now load it through a file URL. The plugin should not load. | 189 // Now load it through a file URL. The plugin should not load. |
| 189 ui_test_utils::NavigateToURL(browser(), | 190 ui_test_utils::NavigateToURL(browser(), |
| 190 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); | 191 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); |
| 191 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 192 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| 192 tab, "testPluginWorks()", &result)); | 193 tab, "testPluginWorks()", &result)); |
| 193 EXPECT_FALSE(result); | 194 EXPECT_FALSE(result); |
| 194 } | 195 } |
| OLD | NEW |