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