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

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

Issue 7828022: Add a method to the HostContentSettings map to return the |Value| of a content setting (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_policy_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
index 89ecacde2ee46f46b7d2108390167a66f9455fbe..abed11bd69124b580af37695952d7960c43f6fac 100644
--- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc
@@ -8,6 +8,7 @@
#include "base/auto_reset.h"
#include "base/command_line.h"
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/content_settings/content_settings_mock_observer.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_switches.h"
@@ -255,8 +256,8 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
PolicyProvider provider(prefs, NULL);
GURL google_url("https://mail.google.com");
// Tests the default setting for auto selecting certificates
- EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- provider.GetContentSetting(
+ EXPECT_EQ(NULL,
+ provider.GetContentSettingValue(
google_url,
google_url,
CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
@@ -265,23 +266,28 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
// Set the content settings pattern list for origins to auto select
// certificates.
ListValue* value = new ListValue();
- value->Append(Value::CreateStringValue("[*.]google.com"));
+ value->Append(Value::CreateStringValue(
+ "[*.]google.com|{\"issuer\":{\"CN\":\"issuer name\"}}"));
prefs->SetManagedPref(prefs::kManagedAutoSelectCertificateForUrls,
value);
GURL youtube_url("https://www.youtube.com");
- EXPECT_EQ(CONTENT_SETTING_DEFAULT,
- provider.GetContentSetting(
+ EXPECT_EQ(NULL,
+ provider.GetContentSettingValue(
youtube_url,
youtube_url,
CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
std::string()));
- EXPECT_EQ(CONTENT_SETTING_ALLOW,
- provider.GetContentSetting(
- google_url,
- google_url,
- CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
- std::string()));
+ scoped_ptr<Value> cert_filter(provider.GetContentSettingValue(
+ google_url,
+ google_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ std::string()));
+
+ ASSERT_EQ(Value::TYPE_DICTIONARY, cert_filter->GetType());
+ EXPECT_TRUE(
+ static_cast<DictionaryValue*>(cert_filter.get())->HasKey("issuer"));
Pam (message me for reviews) 2011/09/02 11:05:29 Can you test at more detail than this, i.e. look a
markusheintz_ 2011/09/02 14:55:59 Done.
provider.ShutdownOnUIThread();
}
+
} // namespace content_settings

Powered by Google App Engine
This is Rietveld 408576698