| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/policy/cloud_policy_service.h" | 8 #include "chrome/browser/policy/cloud_policy_service.h" |
| 9 #include "chrome/browser/policy/configuration_policy_provider_test.h" | 9 #include "chrome/browser/policy/configuration_policy_provider_test.h" |
| 10 #include "chrome/browser/policy/mock_cloud_policy_store.h" | 10 #include "chrome/browser/policy/mock_cloud_policy_store.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ConfigurationPolicyProviderTest, | 128 ConfigurationPolicyProviderTest, |
| 129 testing::Values(TestHarness::CreateMandatory, | 129 testing::Values(TestHarness::CreateMandatory, |
| 130 TestHarness::CreateRecommended)); | 130 TestHarness::CreateRecommended)); |
| 131 | 131 |
| 132 class UserCloudPolicyManagerTest : public testing::Test { | 132 class UserCloudPolicyManagerTest : public testing::Test { |
| 133 protected: | 133 protected: |
| 134 UserCloudPolicyManagerTest() | 134 UserCloudPolicyManagerTest() |
| 135 : store_(NULL) {} | 135 : store_(NULL) {} |
| 136 | 136 |
| 137 virtual void SetUp() OVERRIDE { | 137 virtual void SetUp() OVERRIDE { |
| 138 browser::RegisterLocalState(&prefs_); | 138 chrome::RegisterLocalState(&prefs_); |
| 139 | 139 |
| 140 // Set up a policy map for testing. | 140 // Set up a policy map for testing. |
| 141 policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 141 policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
| 142 base::Value::CreateStringValue("value")); | 142 base::Value::CreateStringValue("value")); |
| 143 expected_bundle_.Get(POLICY_DOMAIN_CHROME, std::string()).CopyFrom( | 143 expected_bundle_.Get(POLICY_DOMAIN_CHROME, std::string()).CopyFrom( |
| 144 policy_map_); | 144 policy_map_); |
| 145 | 145 |
| 146 // Create a fake policy blob to deliver to the client. | 146 // Create a fake policy blob to deliver to the client. |
| 147 em::PolicyData policy_data; | 147 em::PolicyData policy_data; |
| 148 em::PolicyFetchResponse* policy_response = | 148 em::PolicyFetchResponse* policy_response = |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 // Cancelling the initial fetch should flip the flag. | 337 // Cancelling the initial fetch should flip the flag. |
| 338 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); | 338 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); |
| 339 manager_->CancelWaitForPolicyFetch(); | 339 manager_->CancelWaitForPolicyFetch(); |
| 340 EXPECT_TRUE(manager_->IsInitializationComplete()); | 340 EXPECT_TRUE(manager_->IsInitializationComplete()); |
| 341 Mock::VerifyAndClearExpectations(&observer_); | 341 Mock::VerifyAndClearExpectations(&observer_); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace | 344 } // namespace |
| 345 } // namespace policy | 345 } // namespace policy |
| OLD | NEW |