Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/content_settings_pref_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/browser/content_settings/stub_settings_observer.h" | 10 #include "chrome/browser/content_settings/stub_settings_observer.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 228 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 229 AutoReset<CommandLine> auto_reset(cmd, *cmd); | 229 AutoReset<CommandLine> auto_reset(cmd, *cmd); |
| 230 cmd->AppendSwitch(switches::kEnableResourceContentSettings); | 230 cmd->AppendSwitch(switches::kEnableResourceContentSettings); |
| 231 | 231 |
| 232 TestingProfile testing_profile; | 232 TestingProfile testing_profile; |
| 233 PrefProvider pref_content_settings_provider( | 233 PrefProvider pref_content_settings_provider( |
| 234 testing_profile.GetOriginalProfile()); | 234 testing_profile.GetOriginalProfile()); |
| 235 | 235 |
| 236 GURL host("http://example.com/"); | 236 GURL host("http://example.com/"); |
| 237 ContentSettingsPattern pattern("[*.]example.com"); | 237 ContentSettingsPattern pattern("[*.]example.com"); |
| 238 std::string resource1("someplugin"); | 238 std::string resource1("shockwave"); |
|
Bernhard Bauer
2011/02/23 13:18:53
I hope your unit tests don't depend on the actual,
markusheintz_
2011/02/23 18:42:09
Not at all just wanted to have some names that loo
| |
| 239 std::string resource2("otherplugin"); | 239 std::string resource2("java-runtime-environment"); |
| 240 | 240 |
| 241 EXPECT_EQ(CONTENT_SETTING_DEFAULT, | 241 EXPECT_EQ(CONTENT_SETTING_DEFAULT, |
| 242 pref_content_settings_provider.GetContentSetting( | 242 pref_content_settings_provider.GetContentSetting( |
| 243 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource1)); | 243 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource1)); |
| 244 pref_content_settings_provider.SetContentSetting( | 244 pref_content_settings_provider.SetContentSetting( |
| 245 pattern, | 245 pattern, |
| 246 pattern, | 246 pattern, |
| 247 CONTENT_SETTINGS_TYPE_PLUGINS, | 247 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 248 resource1, | 248 resource1, |
| 249 CONTENT_SETTING_BLOCK); | 249 CONTENT_SETTING_BLOCK); |
| 250 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 250 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 251 pref_content_settings_provider.GetContentSetting( | 251 pref_content_settings_provider.GetContentSetting( |
| 252 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource1)); | 252 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource1)); |
| 253 EXPECT_EQ(CONTENT_SETTING_DEFAULT, | 253 EXPECT_EQ(CONTENT_SETTING_DEFAULT, |
| 254 pref_content_settings_provider.GetContentSetting( | 254 pref_content_settings_provider.GetContentSetting( |
| 255 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource2)); | 255 host, host, CONTENT_SETTINGS_TYPE_PLUGINS, resource2)); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace content_settings | 258 } // namespace content_settings |
| OLD | NEW |