| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "chrome/browser/content_settings/content_settings_details.h" | 9 #include "chrome/browser/content_settings/content_settings_details.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 otr_map->SetContentSetting( | 646 otr_map->SetContentSetting( |
| 647 pattern, | 647 pattern, |
| 648 ContentSettingsPattern::Wildcard(), | 648 ContentSettingsPattern::Wildcard(), |
| 649 CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW); | 649 CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW); |
| 650 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 650 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 651 host_content_settings_map->GetContentSetting( | 651 host_content_settings_map->GetContentSetting( |
| 652 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); | 652 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); |
| 653 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 653 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 654 otr_map->GetContentSetting( | 654 otr_map->GetContentSetting( |
| 655 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); | 655 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); |
| 656 |
| 657 otr_map->ShutdownOnUIThread(); |
| 656 } | 658 } |
| 657 | 659 |
| 658 TEST_F(HostContentSettingsMapTest, MigrateObsoletePrefs) { | 660 TEST_F(HostContentSettingsMapTest, MigrateObsoletePrefs) { |
| 659 // This feature is currently behind a flag. | 661 // This feature is currently behind a flag. |
| 660 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 662 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 661 AutoReset<CommandLine> auto_reset(cmd, *cmd); | 663 AutoReset<CommandLine> auto_reset(cmd, *cmd); |
| 662 cmd->AppendSwitch(switches::kEnableResourceContentSettings); | 664 cmd->AppendSwitch(switches::kEnableResourceContentSettings); |
| 663 | 665 |
| 664 TestingProfile profile; | 666 TestingProfile profile; |
| 665 PrefService* prefs = profile.GetPrefs(); | 667 PrefService* prefs = profile.GetPrefs(); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 kAllowedSite, kFirstPartySite, true)); | 1273 kAllowedSite, kFirstPartySite, true)); |
| 1272 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 1274 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 1273 host_content_settings_map->GetCookieContentSetting( | 1275 host_content_settings_map->GetCookieContentSetting( |
| 1274 kAllowedSite, kAllowedSite, false)); | 1276 kAllowedSite, kAllowedSite, false)); |
| 1275 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 1277 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 1276 host_content_settings_map->GetCookieContentSetting( | 1278 host_content_settings_map->GetCookieContentSetting( |
| 1277 kAllowedSite, kAllowedSite, true)); | 1279 kAllowedSite, kAllowedSite, true)); |
| 1278 } | 1280 } |
| 1279 | 1281 |
| 1280 } // namespace | 1282 } // namespace |
| OLD | NEW |