Chromium Code Reviews| Index: chrome/browser/policy/configuration_policy_pref_store_unittest.cc |
| diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc |
| index b89ebdf55b6c7b27b0e670cdf4b7079021d36ff9..ec6e29058260995ace91cdc0b23938c38f04eb70 100644 |
| --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc |
| +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc |
| @@ -87,8 +87,6 @@ INSTANTIATE_TEST_CASE_P( |
| ConfigurationPolicyPrefStoreListTestInstance, |
| ConfigurationPolicyPrefStoreListTest, |
| testing::Values( |
| - PolicyAndPref(key::kRestoreOnStartupURLs, |
| - prefs::kURLsToRestoreOnStartup), |
| PolicyAndPref(key::kDisabledPlugins, |
| prefs::kPluginsDisabledPlugins), |
| PolicyAndPref(key::kDisabledPluginsExceptions, |
| @@ -1071,4 +1069,30 @@ TEST_F(ConfigurationPolicyPrefStoreOthersTest, JavascriptEnabledOverridden) { |
| EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); |
| } |
| +TEST_F(ConfigurationPolicyPrefStoreOthersTest, RestoreOnStartupURLs) { |
| + EXPECT_EQ(PrefStore::READ_NO_VALUE, |
| + store_->GetValue(prefs::kURLsToRestoreOnStartup, NULL)); |
| + EXPECT_EQ(PrefStore::READ_NO_VALUE, |
| + store_->GetValue(prefs::kSyncPromoShowOnFirstRunAllowed, NULL)); |
| + base::ListValue* in_urls = new base::ListValue(); |
| + in_urls->Append(base::Value::CreateStringValue("test1")); |
| + in_urls->Append(base::Value::CreateStringValue("test2,")); |
| + PolicyMap policy; |
| + policy.Set(key::kRestoreOnStartupURLs, POLICY_LEVEL_MANDATORY, |
| + POLICY_SCOPE_USER, in_urls); |
| + provider_.UpdateChromePolicy(policy); |
| + const base::Value* out_urls = NULL; |
| + EXPECT_EQ(PrefStore::READ_OK, |
| + store_->GetValue(prefs::kURLsToRestoreOnStartup, &out_urls)); |
| + ASSERT_TRUE(out_urls); |
| + EXPECT_TRUE(in_urls->Equals(out_urls)); |
| + const base::Value* out_sync_promo_enabled = NULL; |
| + EXPECT_EQ(PrefStore::READ_OK, |
| + store_->GetValue(prefs::kSyncPromoShowOnFirstRunAllowed, |
| + &out_sync_promo_enabled)); |
| + ASSERT_TRUE(out_sync_promo_enabled); |
| + EXPECT_TRUE(base::Value::CreateBooleanValue(false)-> |
|
Mattias Nissler (ping if slow)
2012/05/22 14:58:41
You are leaking the created value here. An alterna
bartfab (slow)
2012/05/22 15:30:54
I leaked it on purpose because I figured in_urls w
Mattias Nissler (ping if slow)
2012/05/22 15:35:44
The rule is "Never leak a thing!", even in unit te
|
| + Equals(out_sync_promo_enabled)); |
| +} |
| + |
| } // namespace policy |