Index: chrome/browser/content_settings/host_content_settings_map_unittest.cc |
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc |
index e6542671185c310bfc89170b242483dda8b505df..0536aedfb1c14b85115d2b90044a656740087b70 100644 |
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc |
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc |
@@ -150,6 +150,8 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { |
CONTENT_SETTING_ASK; |
desired_settings.settings[CONTENT_SETTINGS_TYPE_NOTIFICATIONS] = |
CONTENT_SETTING_ASK; |
+ desired_settings.settings[CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE] = |
+ CONTENT_SETTING_BLOCK; |
ContentSettings settings = |
host_content_settings_map->GetContentSettings(host, host); |
EXPECT_TRUE(SettingsEqual(desired_settings, settings)); |
@@ -596,6 +598,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) { |
CONTENT_SETTING_ASK; |
desired_settings.settings[CONTENT_SETTINGS_TYPE_NOTIFICATIONS] = |
CONTENT_SETTING_ASK; |
+ desired_settings.settings[CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE] = |
+ CONTENT_SETTING_BLOCK; |
ContentSettings settings = |
host_content_settings_map->GetContentSettings(host, host); |
EXPECT_TRUE(SettingsEqual(desired_settings, settings)); |
@@ -786,6 +790,8 @@ TEST_F(HostContentSettingsMapTest, NonDefaultSettings) { |
ContentSettingsPattern::FromString("[*.]example.com"); |
ContentSettings desired_settings(CONTENT_SETTING_DEFAULT); |
+ desired_settings.settings[CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE] = |
+ CONTENT_SETTING_BLOCK; |
ContentSettings settings = |
host_content_settings_map->GetNonDefaultContentSettings(host, host); |
EXPECT_TRUE(SettingsEqual(desired_settings, settings)); |
@@ -1258,4 +1264,42 @@ TEST_F(HostContentSettingsMapTest, CookiesBlockEverythingExceptAllowed) { |
kAllowedSite, kAllowedSite, true)); |
} |
+TEST_F(HostContentSettingsMapTest, AutoSubmitCertificate) { |
Mattias Nissler (ping if slow)
2011/08/09 15:37:25
Isn't this exactly the same test you had before, b
markusheintz_
2011/08/15 19:09:04
You are right. I removed the duplicated test.
|
+ TestingProfile profile; |
+ HostContentSettingsMap* host_content_settings_map = |
+ profile.GetHostContentSettingsMap(); |
+ |
+ EXPECT_EQ(CONTENT_SETTING_BLOCK, |
+ host_content_settings_map->GetDefaultContentSetting( |
+ CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE)); |
+ |
+ GURL example_url("http://www.example.com/"); |
+ EXPECT_EQ(CONTENT_SETTING_BLOCK, |
+ host_content_settings_map->GetContentSetting( |
+ example_url, |
+ example_url, |
+ CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE, |
+ "")); |
+ |
+ // Set the content settings pattern list for origins to auto submit |
+ // certificates. |
+ TestingPrefService* prefs = profile.GetTestingPrefService(); |
+ ListValue* value = new ListValue(); |
+ value->Append(Value::CreateStringValue("[*.]example.com")); |
+ prefs->SetManagedPref(prefs::kManagedAutoSubmitCertificateForUrls, |
+ value); |
+ |
+ EXPECT_EQ(CONTENT_SETTING_ALLOW, |
+ host_content_settings_map->GetContentSetting( |
+ example_url, |
+ example_url, |
+ CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE, |
+ "")); |
+ EXPECT_EQ(CONTENT_SETTING_BLOCK, |
+ host_content_settings_map->GetContentSetting( |
+ GURL("http://www.bar.com/"), |
+ GURL("http://www.bar.com/"), |
+ CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE, |
+ "")); |
+} |
} // namespace |