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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 7537025: Add new Content settings type AUTO-SUBMIT-CERTIFICATE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
index 033b69bb057a5cd28f7a43cf0cc0939b4841595e..c63632f013d6b680c96e5a8760e009feb75ea3ec 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -186,6 +186,23 @@ TEST_F(PrefDefaultProviderTest, MigrateDefaultGeolocationContentSetting) {
provider.ShutdownOnUIThread();
}
+TEST_F(PrefDefaultProviderTest, AutoSubmitCertificateContentSetting) {
+ TestingProfile profile;
+ TestingPrefService* prefs = profile.GetTestingPrefService();
+
+ PrefDefaultProvider provider(prefs, false);
+
+ EXPECT_EQ(CONTENT_SETTING_ASK,
+ provider.ProvideDefaultSetting(
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE));
+ provider.UpdateDefaultSetting(
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, CONTENT_SETTING_ALLOW);
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ provider.ProvideDefaultSetting(
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE));
+ provider.ShutdownOnUIThread();
+}
+
// ////////////////////////////////////////////////////////////////////////////
// PrefProviderTest
//
@@ -688,4 +705,34 @@ TEST_F(PrefProviderTest, SyncObsoleteGeolocationPref) {
provider.ShutdownOnUIThread();
}
+TEST_F(PrefProviderTest, AutoSubmitCertificateContentSetting) {
+ TestingProfile profile;
+ TestingPrefService* prefs = profile.GetTestingPrefService();
+ GURL primary_url("https://www.example.com");
+ GURL secondary_url("https://www.sample.com");
+
+ PrefProvider provider(prefs, false);
+
+ EXPECT_EQ(CONTENT_SETTING_DEFAULT,
+ provider.GetContentSetting(
+ primary_url,
+ primary_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ std::string()));
+
+ provider.SetContentSetting(
+ ContentSettingsPattern::FromURL(primary_url),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ provider.GetContentSetting(
+ primary_url,
+ secondary_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ std::string()));
+ provider.ShutdownOnUIThread();
+}
+
} // namespace content_settings

Powered by Google App Engine
This is Rietveld 408576698