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

Side by Side Diff: chrome/browser/policy/configuration_policy_pref_store_unittest.cc

Issue 7619006: base: Remove using declaration of FundamentalValue as it's no longer necessary. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "chrome/browser/policy/configuration_policy_pref_store.h" 7 #include "chrome/browser/policy/configuration_policy_pref_store.h"
8 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 8 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
9 #include "chrome/browser/prefs/incognito_mode_prefs.h" 9 #include "chrome/browser/prefs/incognito_mode_prefs.h"
10 #include "chrome/browser/prefs/proxy_config_dictionary.h" 10 #include "chrome/browser/prefs/proxy_config_dictionary.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 EXPECT_EQ(PrefStore::READ_NO_VALUE, 259 EXPECT_EQ(PrefStore::READ_NO_VALUE,
260 store_->GetValue(GetParam().pref_name(), NULL)); 260 store_->GetValue(GetParam().pref_name(), NULL));
261 } 261 }
262 262
263 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, SetValue) { 263 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, SetValue) {
264 provider_.AddPolicy(GetParam().type(), Value::CreateIntegerValue(2)); 264 provider_.AddPolicy(GetParam().type(), Value::CreateIntegerValue(2));
265 store_->OnUpdatePolicy(); 265 store_->OnUpdatePolicy();
266 const Value* value = NULL; 266 const Value* value = NULL;
267 EXPECT_EQ(PrefStore::READ_OK, 267 EXPECT_EQ(PrefStore::READ_OK,
268 store_->GetValue(GetParam().pref_name(), &value)); 268 store_->GetValue(GetParam().pref_name(), &value));
269 EXPECT_TRUE(FundamentalValue(2).Equals(value)); 269 EXPECT_TRUE(base::FundamentalValue(2).Equals(value));
270 } 270 }
271 271
272 INSTANTIATE_TEST_CASE_P( 272 INSTANTIATE_TEST_CASE_P(
273 ConfigurationPolicyPrefStoreIntegerTestInstance, 273 ConfigurationPolicyPrefStoreIntegerTestInstance,
274 ConfigurationPolicyPrefStoreIntegerTest, 274 ConfigurationPolicyPrefStoreIntegerTest,
275 testing::Values( 275 testing::Values(
276 TypeAndName(kPolicyRestoreOnStartup, 276 TypeAndName(kPolicyRestoreOnStartup,
277 prefs::kRestoreOnStartup), 277 prefs::kRestoreOnStartup),
278 TypeAndName(kPolicyPolicyRefreshRate, 278 TypeAndName(kPolicyPolicyRefreshRate,
279 prefs::kUserPolicyRefreshRate), 279 prefs::kUserPolicyRefreshRate),
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 provider_.AddPolicy(kPolicyIncognitoModeAvailability, 716 provider_.AddPolicy(kPolicyIncognitoModeAvailability,
717 Value::CreateIntegerValue(availability)); 717 Value::CreateIntegerValue(availability));
718 } 718 }
719 store_ = new ConfigurationPolicyPrefStore(&provider_); 719 store_ = new ConfigurationPolicyPrefStore(&provider_);
720 } 720 }
721 721
722 void VerifyValues(IncognitoModePrefs::Availability availability) { 722 void VerifyValues(IncognitoModePrefs::Availability availability) {
723 const Value* value = NULL; 723 const Value* value = NULL;
724 EXPECT_EQ(PrefStore::READ_OK, 724 EXPECT_EQ(PrefStore::READ_OK,
725 store_->GetValue(prefs::kIncognitoModeAvailability, &value)); 725 store_->GetValue(prefs::kIncognitoModeAvailability, &value));
726 EXPECT_TRUE(FundamentalValue(availability).Equals(value)); 726 EXPECT_TRUE(base::FundamentalValue(availability).Equals(value));
727 } 727 }
728 728
729 MockConfigurationPolicyProvider provider_; 729 MockConfigurationPolicyProvider provider_;
730 scoped_refptr<ConfigurationPolicyPrefStore> store_; 730 scoped_refptr<ConfigurationPolicyPrefStore> store_;
731 }; 731 };
732 732
733 // The following testcases verify that if the obsolete IncognitoEnabled 733 // The following testcases verify that if the obsolete IncognitoEnabled
734 // policy is not set, the IncognitoModeAvailability values should be copied 734 // policy is not set, the IncognitoModeAvailability values should be copied
735 // from IncognitoModeAvailability policy to pref "as is". 735 // from IncognitoModeAvailability policy to pref "as is".
736 TEST_F(ConfigurationPolicyPrefStoreIncognitoModeTest, 736 TEST_F(ConfigurationPolicyPrefStoreIncognitoModeTest,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 960
961 provider_.SetInitializationComplete(true); 961 provider_.SetInitializationComplete(true);
962 EXPECT_FALSE(store_->IsInitializationComplete()); 962 EXPECT_FALSE(store_->IsInitializationComplete());
963 963
964 store_->OnUpdatePolicy(); 964 store_->OnUpdatePolicy();
965 Mock::VerifyAndClearExpectations(&observer_); 965 Mock::VerifyAndClearExpectations(&observer_);
966 EXPECT_TRUE(store_->IsInitializationComplete()); 966 EXPECT_TRUE(store_->IsInitializationComplete());
967 } 967 }
968 968
969 } // namespace policy 969 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud_policy_provider_unittest.cc ('k') | chrome/browser/policy/device_policy_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698