OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/policy/configuration_policy_pref_store.h" | 5 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
6 #include "chrome/browser/policy/file_based_policy_provider.h" | 6 #include "chrome/browser/policy/file_based_policy_provider.h" |
7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 using testing::Mock; | 10 using testing::Mock; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // A mock provider that allows us to capture reload notifications. | 44 // A mock provider that allows us to capture reload notifications. |
45 class MockPolicyProvider : public ConfigurationPolicyProvider, | 45 class MockPolicyProvider : public ConfigurationPolicyProvider, |
46 public base::SupportsWeakPtr<MockPolicyProvider> { | 46 public base::SupportsWeakPtr<MockPolicyProvider> { |
47 public: | 47 public: |
48 explicit MockPolicyProvider() | 48 explicit MockPolicyProvider() |
49 : ConfigurationPolicyProvider( | 49 : ConfigurationPolicyProvider( |
50 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList()) { | 50 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList()) { |
51 } | 51 } |
52 | 52 |
53 virtual bool Provide(ConfigurationPolicyStore* store) { | 53 virtual bool Provide(ConfigurationPolicyStoreInterface* store) { |
54 return true; | 54 return true; |
55 } | 55 } |
56 | 56 |
57 MOCK_METHOD0(NotifyStoreOfPolicyChange, void()); | 57 MOCK_METHOD0(NotifyStoreOfPolicyChange, void()); |
58 }; | 58 }; |
59 | 59 |
60 class FileBasedPolicyLoaderTest : public testing::Test { | 60 class FileBasedPolicyLoaderTest : public testing::Test { |
61 protected: | 61 protected: |
62 FileBasedPolicyLoaderTest() | 62 FileBasedPolicyLoaderTest() |
63 : ui_thread_(BrowserThread::UI, &loop_), | 63 : ui_thread_(BrowserThread::UI, &loop_), |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 EXPECT_EQ(1U, policy->size()); | 122 EXPECT_EQ(1U, policy->size()); |
123 | 123 |
124 std::string str_value; | 124 std::string str_value; |
125 EXPECT_TRUE(policy->GetString("HomepageLocation", &str_value)); | 125 EXPECT_TRUE(policy->GetString("HomepageLocation", &str_value)); |
126 EXPECT_EQ("http://www.google.com", str_value); | 126 EXPECT_EQ("http://www.google.com", str_value); |
127 | 127 |
128 loader->Stop(); | 128 loader->Stop(); |
129 } | 129 } |
130 | 130 |
131 } // namespace policy | 131 } // namespace policy |
OLD | NEW |