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

Side by Side Diff: chrome/browser/plugins/plugin_prefs_unittest.cc

Issue 645203002: Block NPAPI plugins by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move UMA outside ifdef Created 5 years, 11 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
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/plugins/plugin_prefs.h" 5 #include "chrome/browser/plugins/plugin_prefs.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 // Linux Aura doesn't support NPAPI. 202 // Linux Aura doesn't support NPAPI.
203 #if !(defined(OS_LINUX) && defined(USE_AURA)) 203 #if !(defined(OS_LINUX) && defined(USE_AURA))
204 204
205 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { 205 TEST_F(PluginPrefsTest, UnifiedPepperFlashState) {
206 content::TestBrowserThreadBundle browser_threads; 206 content::TestBrowserThreadBundle browser_threads;
207 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. 207 base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService.
208 208
209 PluginService::GetInstance()->Init(); 209 PluginService::GetInstance()->Init();
210 PluginService::GetInstance()->DisablePluginsDiscoveryForTesting(); 210 PluginService::GetInstance()->DisablePluginsDiscoveryForTesting();
211 PluginService::GetInstance()->EnableNpapiPluginsForTesting();
211 212
212 base::string16 component_updated_plugin_name( 213 base::string16 component_updated_plugin_name(
213 ASCIIToUTF16("Component-updated Pepper Flash")); 214 ASCIIToUTF16("Component-updated Pepper Flash"));
214 content::WebPluginInfo component_updated_plugin_1( 215 content::WebPluginInfo component_updated_plugin_1(
215 component_updated_plugin_name, 216 component_updated_plugin_name,
216 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")), 217 GetComponentUpdatedPepperFlashPath(FILE_PATH_LITERAL("11.3.31.227")),
217 ASCIIToUTF16("11.3.31.227"), 218 ASCIIToUTF16("11.3.31.227"),
218 ASCIIToUTF16("")); 219 ASCIIToUTF16(""));
219 content::WebPluginInfo component_updated_plugin_2( 220 content::WebPluginInfo component_updated_plugin_2(
220 component_updated_plugin_name, 221 component_updated_plugin_name,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); 273 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2));
273 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); 274 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(bundled_plugin));
274 275
275 EnablePluginSynchronously(true, bundled_plugin.path, true); 276 EnablePluginSynchronously(true, bundled_plugin.path, true);
276 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1)); 277 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_1));
277 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2)); 278 EXPECT_FALSE(plugin_prefs_->IsPluginEnabled(component_updated_plugin_2));
278 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin)); 279 EXPECT_TRUE(plugin_prefs_->IsPluginEnabled(bundled_plugin));
279 } 280 }
280 281
281 #endif 282 #endif
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698