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

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

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unittest for asyn reading Created 9 years, 7 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/proxy_config_dictionary.h" 9 #include "chrome/browser/prefs/proxy_config_dictionary.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 provider_.RemovePolicy(kPolicyHomepageLocation); 742 provider_.RemovePolicy(kPolicyHomepageLocation);
743 store_->OnUpdatePolicy(); 743 store_->OnUpdatePolicy();
744 Mock::VerifyAndClearExpectations(&observer_); 744 Mock::VerifyAndClearExpectations(&observer_);
745 EXPECT_EQ(PrefStore::READ_NO_VALUE, 745 EXPECT_EQ(PrefStore::READ_NO_VALUE,
746 store_->GetValue(prefs::kHomePage, NULL)); 746 store_->GetValue(prefs::kHomePage, NULL));
747 } 747 }
748 748
749 TEST_F(ConfigurationPolicyPrefStoreRefreshTest, Initialization) { 749 TEST_F(ConfigurationPolicyPrefStoreRefreshTest, Initialization) {
750 EXPECT_FALSE(store_->IsInitializationComplete()); 750 EXPECT_FALSE(store_->IsInitializationComplete());
751 751
752 EXPECT_CALL(observer_, OnInitializationCompleted()).Times(1); 752 EXPECT_CALL(observer_, OnInitializationCompleted(true)).Times(1);
753 753
754 provider_.SetInitializationComplete(true); 754 provider_.SetInitializationComplete(true);
755 EXPECT_FALSE(store_->IsInitializationComplete()); 755 EXPECT_FALSE(store_->IsInitializationComplete());
756 756
757 store_->OnUpdatePolicy(); 757 store_->OnUpdatePolicy();
758 Mock::VerifyAndClearExpectations(&observer_); 758 Mock::VerifyAndClearExpectations(&observer_);
759 EXPECT_TRUE(store_->IsInitializationComplete()); 759 EXPECT_TRUE(store_->IsInitializationComplete());
760 } 760 }
761 761
762 } // namespace policy 762 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698