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

Unified Diff: chrome/browser/policy/device_management_policy_provider_unittest.cc

Issue 6074003: Handle policy refresh internally in ConfigurationPolicyPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit Created 10 years 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/device_management_policy_provider_unittest.cc
diff --git a/chrome/browser/policy/device_management_policy_provider_unittest.cc b/chrome/browser/policy/device_management_policy_provider_unittest.cc
index 3d85397fae7249a7325775a24275b1f701deaca6..a4127b7f874ff58fa67ad42eab2266c9495108b6 100644
--- a/chrome/browser/policy/device_management_policy_provider_unittest.cc
+++ b/chrome/browser/policy/device_management_policy_provider_unittest.cc
@@ -39,7 +39,7 @@ class DeviceManagementPolicyProviderTest : public testing::Test {
virtual void SetUp() {
profile_.reset(new TestingProfile);
CreateNewProvider();
- EXPECT_TRUE(provider_->waiting_for_initial_policies());
+ EXPECT_TRUE(waiting_for_initial_policies());
loop_.RunAllPending();
}
@@ -99,7 +99,7 @@ class DeviceManagementPolicyProviderTest : public testing::Test {
MockDeviceManagementBackendSucceedBooleanPolicy(
key::kDisableSpdy, true));
SimulateSuccessfulLoginAndRunPending();
- EXPECT_FALSE(provider_->waiting_for_initial_policies());
+ EXPECT_FALSE(waiting_for_initial_policies());
EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(1);
provider_->Provide(&store);
ASSERT_EQ(1U, store.policy_map().size());
@@ -111,6 +111,10 @@ class DeviceManagementPolicyProviderTest : public testing::Test {
loop_.RunAllPending();
}
+ bool waiting_for_initial_policies() const {
+ return provider_->waiting_for_initial_policies_;
+ }
+
MockDeviceManagementBackend* backend_; // weak
scoped_ptr<DeviceManagementPolicyProvider> provider_;
@@ -136,14 +140,14 @@ TEST_F(DeviceManagementPolicyProviderTest, InitialProvideNoLogin) {
EXPECT_CALL(store, Apply(_, _)).Times(0);
provider_->Provide(&store);
EXPECT_TRUE(store.policy_map().empty());
- EXPECT_TRUE(provider_->waiting_for_initial_policies());
+ EXPECT_TRUE(waiting_for_initial_policies());
}
// If the login is successful and there's no previously-fetched policy, the
// policy should be fetched from the server and should be available the first
// time the Provide method is called.
TEST_F(DeviceManagementPolicyProviderTest, InitialProvideWithLogin) {
- EXPECT_TRUE(provider_->waiting_for_initial_policies());
+ EXPECT_TRUE(waiting_for_initial_policies());
SimulateSuccessfulInitialPolicyFetch();
}
@@ -305,7 +309,7 @@ TEST_F(DeviceManagementPolicyProviderTest, UnmanagedDevice) {
// (2) On restart, the provider should detect that this is not the first
// login.
CreateNewProvider(1000*1000, 0, 0, 0, 0);
- EXPECT_FALSE(provider_->waiting_for_initial_policies());
+ EXPECT_FALSE(waiting_for_initial_policies());
EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce(
MockDeviceManagementBackendSucceedRegister());
EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce(

Powered by Google App Engine
This is Rietveld 408576698