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

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

Issue 3774003: Cleanup and style guideline conformance for policy implementation (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: fix windows build and tests Created 10 years, 1 month 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/policy/file_based_policy_provider.cc ('k') | chrome/browser/policy/mock_configuration_policy_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698