Chromium Code Reviews| 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 |