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

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

Issue 6079012: Allow policy refresh rate to be configured through policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build. Created 9 years, 11 months 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 | Annotate | Revision Log
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 "base/file_path.h" 5 #include "base/file_path.h"
6 #include "chrome/browser/policy/configuration_policy_pref_store.h" 6 #include "chrome/browser/policy/configuration_policy_pref_store.h"
7 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 7 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
8 #include "chrome/browser/prefs/proxy_prefs.h" 8 #include "chrome/browser/prefs/proxy_prefs.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/notification_service.h" 10 #include "chrome/common/notification_service.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 EXPECT_EQ(PrefStore::READ_OK, 214 EXPECT_EQ(PrefStore::READ_OK,
215 store_.GetValue(GetParam().pref_name(), &value)); 215 store_.GetValue(GetParam().pref_name(), &value));
216 EXPECT_TRUE(FundamentalValue(2).Equals(value)); 216 EXPECT_TRUE(FundamentalValue(2).Equals(value));
217 } 217 }
218 218
219 INSTANTIATE_TEST_CASE_P( 219 INSTANTIATE_TEST_CASE_P(
220 ConfigurationPolicyPrefStoreIntegerTestInstance, 220 ConfigurationPolicyPrefStoreIntegerTestInstance,
221 ConfigurationPolicyPrefStoreIntegerTest, 221 ConfigurationPolicyPrefStoreIntegerTest,
222 testing::Values( 222 testing::Values(
223 TypeAndName(kPolicyRestoreOnStartup, 223 TypeAndName(kPolicyRestoreOnStartup,
224 prefs::kRestoreOnStartup))); 224 prefs::kRestoreOnStartup),
225 TypeAndName(kPolicyPolicyRefreshRate,
226 prefs::kPolicyRefreshRate)));
225 227
226 // Test cases for the proxy policy settings. 228 // Test cases for the proxy policy settings.
227 class ConfigurationPolicyPrefStoreProxyTest : public testing::Test { 229 class ConfigurationPolicyPrefStoreProxyTest : public testing::Test {
228 protected: 230 protected:
229 // Verify that all the proxy prefs are set to the specified expected values. 231 // Verify that all the proxy prefs are set to the specified expected values.
230 static void VerifyProxyPrefs( 232 static void VerifyProxyPrefs(
231 const ConfigurationPolicyPrefStore& store, 233 const ConfigurationPolicyPrefStore& store,
232 const std::string& expected_proxy_server, 234 const std::string& expected_proxy_server,
233 const std::string& expected_proxy_pac_url, 235 const std::string& expected_proxy_pac_url,
234 const std::string& expected_proxy_bypass_list, 236 const std::string& expected_proxy_bypass_list,
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 634
633 provider_.SetInitializationComplete(true); 635 provider_.SetInitializationComplete(true);
634 EXPECT_FALSE(store_.IsInitializationComplete()); 636 EXPECT_FALSE(store_.IsInitializationComplete());
635 637
636 store_.OnUpdatePolicy(); 638 store_.OnUpdatePolicy();
637 Mock::VerifyAndClearExpectations(&observer_); 639 Mock::VerifyAndClearExpectations(&observer_);
638 EXPECT_TRUE(store_.IsInitializationComplete()); 640 EXPECT_TRUE(store_.IsInitializationComplete());
639 } 641 }
640 642
641 } // namespace policy 643 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698