| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/cloud_policy_controller.h" | 5 #include "chrome/browser/policy/cloud_policy_controller.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "chrome/browser/policy/cloud_policy_data_store.h" | 9 #include "chrome/browser/policy/cloud_policy_data_store.h" |
| 10 #include "chrome/browser/policy/device_token_fetcher.h" | 10 #include "chrome/browser/policy/device_token_fetcher.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 data_store_.reset(); | 64 data_store_.reset(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void CreateNewController() { | 67 void CreateNewController() { |
| 68 controller_.reset(new CloudPolicyController( | 68 controller_.reset(new CloudPolicyController( |
| 69 &service_, cache_.get(), token_fetcher_.get(), data_store_.get(), | 69 &service_, cache_.get(), token_fetcher_.get(), data_store_.get(), |
| 70 ¬ifier_, new DummyWorkScheduler)); | 70 ¬ifier_, new DummyWorkScheduler)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ExpectHasSpdyPolicy() { | 73 void ExpectHasSpdyPolicy() { |
| 74 FundamentalValue expected(true); | 74 base::FundamentalValue expected(true); |
| 75 const PolicyMap* policy_map = cache_->policy( | 75 const PolicyMap* policy_map = cache_->policy( |
| 76 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY); | 76 CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY); |
| 77 ASSERT_TRUE(Value::Equals(&expected, policy_map->Get(kPolicyDisableSpdy))); | 77 ASSERT_TRUE(Value::Equals(&expected, policy_map->Get(kPolicyDisableSpdy))); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void StopMessageLoop() { | 80 void StopMessageLoop() { |
| 81 loop_.QuitNow(); | 81 loop_.QuitNow(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 protected: | 84 protected: |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 "who@what.com", "auth", true); | 206 "who@what.com", "auth", true); |
| 207 EXPECT_CALL(backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 207 EXPECT_CALL(backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
| 208 MockDeviceManagementBackendFailPolicy( | 208 MockDeviceManagementBackendFailPolicy( |
| 209 DeviceManagementBackend::kErrorServiceManagementNotSupported)); | 209 DeviceManagementBackend::kErrorServiceManagementNotSupported)); |
| 210 EXPECT_CALL(*token_fetcher_.get(), SetUnmanagedState()).Times(1); | 210 EXPECT_CALL(*token_fetcher_.get(), SetUnmanagedState()).Times(1); |
| 211 CreateNewController(); | 211 CreateNewController(); |
| 212 loop_.RunAllPending(); | 212 loop_.RunAllPending(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace policy | 215 } // namespace policy |
| OLD | NEW |