Chromium Code Reviews| 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, |