Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: chrome/browser/extensions/plugin_apitest.cc

Issue 10982037: Revert 158217 - Allow extensions which can run without NPAPI to run under Windows 8 Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/requirements_checker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 { 81 {
82 content::WindowedNotificationObserver observer( 82 content::WindowedNotificationObserver observer(
83 content::NOTIFICATION_LOAD_STOP, 83 content::NOTIFICATION_LOAD_STOP,
84 content::Source<NavigationController>( 84 content::Source<NavigationController>(
85 &chrome::GetActiveWebContents(browser())->GetController())); 85 &chrome::GetActiveWebContents(browser())->GetController()));
86 chrome::Reload(browser(), CURRENT_TAB); 86 chrome::Reload(browser(), CURRENT_TAB);
87 observer.Wait(); 87 observer.Wait();
88 } 88 }
89 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 89 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
90 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); 90 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result));
91 // We don't allow extension plugins to run on ChromeOS. 91 // We don't allow extension plugins to run on ChromeOS.
92 #if defined(OS_CHROMEOS) 92 #if defined(OS_CHROMEOS)
93 EXPECT_FALSE(result); 93 EXPECT_FALSE(result);
94 #else 94 #else
95 EXPECT_TRUE(result); 95 EXPECT_TRUE(result);
96 #endif 96 #endif
97 } 97 }
98 98
99 // Tests that private extension plugins are only visible to the extension. 99 // Tests that private extension plugins are only visible to the extension.
100 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PluginPrivate) { 100 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PluginPrivate) {
101 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize, 101 browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize,
102 true); 102 true);
103 103
104 FilePath extension_dir = 104 FilePath extension_dir =
105 test_data_dir_.AppendASCII("uitest").AppendASCII("plugins_private"); 105 test_data_dir_.AppendASCII("uitest").AppendASCII("plugins_private");
106 106
(...skipping 21 matching lines...) Expand all
128 EXPECT_TRUE(result); 128 EXPECT_TRUE(result);
129 #endif 129 #endif
130 130
131 // Regression test for http://crbug.com/131811: The plug-in should be 131 // Regression test for http://crbug.com/131811: The plug-in should be
132 // whitelisted for the extension (and only for the extension), so it should be 132 // whitelisted for the extension (and only for the extension), so it should be
133 // loaded even if content settings are set to block plug-ins. 133 // loaded even if content settings are set to block plug-ins.
134 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( 134 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
135 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); 135 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
136 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 136 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
137 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); 137 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result));
138 // We don't allow extension plugins to run on ChromeOS.
139 #if defined(OS_CHROMEOS) 138 #if defined(OS_CHROMEOS)
140 EXPECT_FALSE(result); 139 EXPECT_FALSE(result);
141 #else 140 #else
142 EXPECT_TRUE(result); 141 EXPECT_TRUE(result);
143 #endif 142 #endif
144 143
145 // 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.
146 ui_test_utils::NavigateToURL(browser(), 145 ui_test_utils::NavigateToURL(browser(),
147 net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); 146 net::FilePathToFileURL(extension_dir.AppendASCII("test.html")));
148 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 147 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
149 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); 148 tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result));
150 EXPECT_FALSE(result); 149 EXPECT_FALSE(result);
151 } 150 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/requirements_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698