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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 provider_.RemovePolicy(kPolicyHomepageLocation); | 812 provider_.RemovePolicy(kPolicyHomepageLocation); |
813 store_->OnUpdatePolicy(); | 813 store_->OnUpdatePolicy(); |
814 Mock::VerifyAndClearExpectations(&observer_); | 814 Mock::VerifyAndClearExpectations(&observer_); |
815 EXPECT_EQ(PrefStore::READ_NO_VALUE, | 815 EXPECT_EQ(PrefStore::READ_NO_VALUE, |
816 store_->GetValue(prefs::kHomePage, NULL)); | 816 store_->GetValue(prefs::kHomePage, NULL)); |
817 } | 817 } |
818 | 818 |
819 TEST_F(ConfigurationPolicyPrefStoreRefreshTest, Initialization) { | 819 TEST_F(ConfigurationPolicyPrefStoreRefreshTest, Initialization) { |
820 EXPECT_FALSE(store_->IsInitializationComplete()); | 820 EXPECT_FALSE(store_->IsInitializationComplete()); |
821 | 821 |
822 EXPECT_CALL(observer_, OnInitializationCompleted()).Times(1); | 822 EXPECT_CALL(observer_, OnInitializationCompleted(true)).Times(1); |
823 | 823 |
824 provider_.SetInitializationComplete(true); | 824 provider_.SetInitializationComplete(true); |
825 EXPECT_FALSE(store_->IsInitializationComplete()); | 825 EXPECT_FALSE(store_->IsInitializationComplete()); |
826 | 826 |
827 store_->OnUpdatePolicy(); | 827 store_->OnUpdatePolicy(); |
828 Mock::VerifyAndClearExpectations(&observer_); | 828 Mock::VerifyAndClearExpectations(&observer_); |
829 EXPECT_TRUE(store_->IsInitializationComplete()); | 829 EXPECT_TRUE(store_->IsInitializationComplete()); |
830 } | 830 } |
831 | 831 |
832 } // namespace policy | 832 } // namespace policy |
OLD | NEW |