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

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

Issue 7218073: Explicitly ShutdownOnUIThread the HostContentSettingsMap when destroying the Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 otr_map->SetContentSetting( 653 otr_map->SetContentSetting(
654 pattern, 654 pattern,
655 ContentSettingsPattern::Wildcard(), 655 ContentSettingsPattern::Wildcard(),
656 CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW); 656 CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW);
657 EXPECT_EQ(CONTENT_SETTING_BLOCK, 657 EXPECT_EQ(CONTENT_SETTING_BLOCK,
658 host_content_settings_map->GetContentSetting( 658 host_content_settings_map->GetContentSetting(
659 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); 659 host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
660 EXPECT_EQ(CONTENT_SETTING_ALLOW, 660 EXPECT_EQ(CONTENT_SETTING_ALLOW,
661 otr_map->GetContentSetting( 661 otr_map->GetContentSetting(
662 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); 662 host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
663
664 otr_map->ShutdownOnUIThread();
663 } 665 }
664 666
665 TEST_F(HostContentSettingsMapTest, MigrateObsoletePrefs) { 667 TEST_F(HostContentSettingsMapTest, MigrateObsoletePrefs) {
666 // This feature is currently behind a flag. 668 // This feature is currently behind a flag.
667 CommandLine* cmd = CommandLine::ForCurrentProcess(); 669 CommandLine* cmd = CommandLine::ForCurrentProcess();
668 AutoReset<CommandLine> auto_reset(cmd, *cmd); 670 AutoReset<CommandLine> auto_reset(cmd, *cmd);
669 cmd->AppendSwitch(switches::kEnableResourceContentSettings); 671 cmd->AppendSwitch(switches::kEnableResourceContentSettings);
670 672
671 TestingProfile profile; 673 TestingProfile profile;
672 PrefService* prefs = profile.GetPrefs(); 674 PrefService* prefs = profile.GetPrefs();
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 kAllowedSite, kFirstPartySite, true)); 1252 kAllowedSite, kFirstPartySite, true));
1251 EXPECT_EQ(CONTENT_SETTING_ALLOW, 1253 EXPECT_EQ(CONTENT_SETTING_ALLOW,
1252 host_content_settings_map->GetCookieContentSetting( 1254 host_content_settings_map->GetCookieContentSetting(
1253 kAllowedSite, kAllowedSite, false)); 1255 kAllowedSite, kAllowedSite, false));
1254 EXPECT_EQ(CONTENT_SETTING_ALLOW, 1256 EXPECT_EQ(CONTENT_SETTING_ALLOW,
1255 host_content_settings_map->GetCookieContentSetting( 1257 host_content_settings_map->GetCookieContentSetting(
1256 kAllowedSite, kAllowedSite, true)); 1258 kAllowedSite, kAllowedSite, true));
1257 } 1259 }
1258 1260
1259 } // namespace 1261 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698