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

Side by Side Diff: chrome/browser/content_settings/content_settings_browsertest.cc

Issue 1158423003: Disable NPAPI support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove enterprise policy override based on revert of 26d09db Created 5 years, 6 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.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/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/content_settings/cookie_settings.h" 10 #include "chrome/browser/content_settings/cookie_settings.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 #if defined(OS_MACOSX) 320 #if defined(OS_MACOSX)
321 base::FilePath plugin_dir; 321 base::FilePath plugin_dir;
322 PathService::Get(base::DIR_MODULE, &plugin_dir); 322 PathService::Get(base::DIR_MODULE, &plugin_dir);
323 plugin_dir = plugin_dir.AppendASCII("plugins"); 323 plugin_dir = plugin_dir.AppendASCII("plugins");
324 // The plugins directory isn't read by default on the Mac, so it needs to be 324 // The plugins directory isn't read by default on the Mac, so it needs to be
325 // explicitly registered. 325 // explicitly registered.
326 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir); 326 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
327 #endif 327 #endif
328 command_line->AppendSwitch(switches::kAlwaysAuthorizePlugins); 328 command_line->AppendSwitch(switches::kAlwaysAuthorizePlugins);
329 if (expect_loaded) 329 if (expect_loaded)
330 command_line->AppendSwitch(switches::kEnableNpapi); 330 command_line->AppendSwitch(switches::kEnableNpapiForTesting);
331 } 331 }
332 }; 332 };
333 333
334 class DisabledPluginTest : public LoadPluginTest { 334 class DisabledPluginTest : public LoadPluginTest {
335 public: 335 public:
336 DisabledPluginTest() {} 336 DisabledPluginTest() {}
337 337
338 void SetUpCommandLine(base::CommandLine* command_line) override { 338 void SetUpCommandLine(base::CommandLine* command_line) override {
339 SetUpCommandLineInternal(command_line, false); 339 SetUpCommandLineInternal(command_line, false);
340 } 340 }
(...skipping 22 matching lines...) Expand all
363 363
364 void SetUpCommandLine(base::CommandLine* command_line) override { 364 void SetUpCommandLine(base::CommandLine* command_line) override {
365 #if defined(OS_MACOSX) 365 #if defined(OS_MACOSX)
366 base::FilePath plugin_dir; 366 base::FilePath plugin_dir;
367 PathService::Get(base::DIR_MODULE, &plugin_dir); 367 PathService::Get(base::DIR_MODULE, &plugin_dir);
368 plugin_dir = plugin_dir.AppendASCII("plugins"); 368 plugin_dir = plugin_dir.AppendASCII("plugins");
369 // The plugins directory isn't read by default on the Mac, so it needs to be 369 // The plugins directory isn't read by default on the Mac, so it needs to be
370 // explicitly registered. 370 // explicitly registered.
371 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir); 371 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
372 #endif 372 #endif
373 command_line->AppendSwitch(switches::kEnableNpapi); 373 command_line->AppendSwitch(switches::kEnableNpapiForTesting);
jam 2015/05/28 19:22:38 just delete these two tests
374 } 374 }
375 }; 375 };
376 376
377 IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) { 377 IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) {
378 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( 378 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
379 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); 379 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
380 380
381 GURL url = ui_test_utils::GetTestUrl( 381 GURL url = ui_test_utils::GetTestUrl(
382 base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html")); 382 base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html"));
383 ui_test_utils::NavigateToURL(browser(), url); 383 ui_test_utils::NavigateToURL(browser(), url);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 796 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
797 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 797 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
798 switches::kAshBrowserTests)) 798 switches::kAshBrowserTests))
799 return; 799 return;
800 #endif 800 #endif
801 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); 801 RunJavaScriptBlockedTest("load_nacl_no_js.html", true);
802 } 802 }
803 #endif // !defined(DISABLE_NACL) 803 #endif // !defined(DISABLE_NACL)
804 804
805 #endif // defined(ENABLE_PLUGINS) 805 #endif // defined(ENABLE_PLUGINS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698