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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_core_unittest.cc

Issue 27536003: Moved prefs::kUserPolicyRefreshRate to component/policy/policy_pref_names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/cloud/cloud_policy_core_unittest.cc
diff --git a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc
index ef0313ed60fff57193e45ba7c41d4a87324f0e5b..7d57735141b960e23e6c723aafe26c99e7eccc06 100644
--- a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc
@@ -6,13 +6,13 @@
#include "base/basictypes.h"
#include "base/message_loop/message_loop.h"
+#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/testing_pref_service.h"
#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
#include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
-#include "chrome/browser/prefs/browser_prefs.h"
-#include "chrome/common/pref_names.h"
+#include "components/policy/core/common/policy_pref_names.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace policy {
@@ -29,7 +29,9 @@ class CloudPolicyCoreTest : public testing::Test,
refresh_scheduler_started_callback_count_(0),
core_disconnecting_callback_count_(0),
bad_callback_count_(0) {
- chrome::RegisterLocalState(prefs_.registry());
+ prefs_.registry()->RegisterIntegerPref(
+ policy_prefs::kUserPolicyRefreshRate,
+ CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs);
core_.AddObserver(this);
}
@@ -120,11 +122,11 @@ TEST_F(CloudPolicyCoreTest, RefreshScheduler) {
int default_refresh_delay = core_.refresh_scheduler()->refresh_delay();
const int kRefreshRate = 1000 * 60 * 60;
- prefs_.SetInteger(prefs::kUserPolicyRefreshRate, kRefreshRate);
- core_.TrackRefreshDelayPref(&prefs_, prefs::kUserPolicyRefreshRate);
+ prefs_.SetInteger(policy_prefs::kUserPolicyRefreshRate, kRefreshRate);
+ core_.TrackRefreshDelayPref(&prefs_, policy_prefs::kUserPolicyRefreshRate);
EXPECT_EQ(kRefreshRate, core_.refresh_scheduler()->refresh_delay());
- prefs_.ClearPref(prefs::kUserPolicyRefreshRate);
+ prefs_.ClearPref(policy_prefs::kUserPolicyRefreshRate);
EXPECT_EQ(default_refresh_delay, core_.refresh_scheduler()->refresh_delay());
EXPECT_EQ(1, core_connected_callback_count_);
« no previous file with comments | « chrome/browser/policy/cloud/DEPS ('k') | chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698