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

Unified Diff: chrome/browser/host_content_settings_map_unittest.cc

Issue 4643007: Move click-to-play to about:flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/host_content_settings_map_unittest.cc
diff --git a/chrome/browser/host_content_settings_map_unittest.cc b/chrome/browser/host_content_settings_map_unittest.cc
index b5c74a09a220d006815a3be000c39f9a631b717f..69480fa91f8e01409307f01cd580f4361c4d7fe0 100644
--- a/chrome/browser/host_content_settings_map_unittest.cc
+++ b/chrome/browser/host_content_settings_map_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/host_content_settings_map.h"
+#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
@@ -90,11 +91,18 @@ TEST_F(HostContentSettingsMapTest, DefaultValues) {
EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting(
GURL(chrome::kChromeUINewTabURL),
CONTENT_SETTINGS_TYPE_IMAGES, ""));
- host_content_settings_map->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK);
- EXPECT_EQ(CONTENT_SETTING_ASK,
- host_content_settings_map->GetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS));
+ {
+ // Click-to-play needs to be enabled to set the content setting to ASK.
+ CommandLine* cmd = CommandLine::ForCurrentProcess();
jochen (gone - plz use gerrit) 2010/11/12 13:38:05 can you make the other unit tests use this pattern
+ AutoReset<CommandLine> auto_reset(cmd, *cmd);
+ cmd->AppendSwitch(switches::kEnableClickToPlay);
+
+ host_content_settings_map->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK);
+ EXPECT_EQ(CONTENT_SETTING_ASK,
+ host_content_settings_map->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_PLUGINS));
+ }
host_content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW);
EXPECT_EQ(CONTENT_SETTING_ALLOW,

Powered by Google App Engine
This is Rietveld 408576698