OLD | NEW |
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 Loading... |
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 |
OLD | NEW |