| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/policy/browser_policy_connector.h" | 9 #include "chrome/browser/policy/browser_policy_connector.h" |
| 10 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 10 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // Give a bogus OAuth token to the |policy_manager|. This should make its | 115 // Give a bogus OAuth token to the |policy_manager|. This should make its |
| 116 // CloudPolicyClient fetch the DMToken. | 116 // CloudPolicyClient fetch the DMToken. |
| 117 em::DeviceRegisterRequest::Type registration_type = | 117 em::DeviceRegisterRequest::Type registration_type = |
| 118 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
| 119 em::DeviceRegisterRequest::USER; | 119 em::DeviceRegisterRequest::USER; |
| 120 #else | 120 #else |
| 121 em::DeviceRegisterRequest::BROWSER; | 121 em::DeviceRegisterRequest::BROWSER; |
| 122 #endif | 122 #endif |
| 123 policy_manager()->core()->client()->Register( | 123 policy_manager()->core()->client()->Register( |
| 124 registration_type, "bogus", std::string(), false); | 124 registration_type, "bogus", std::string(), false, std::string()); |
| 125 run_loop.Run(); | 125 run_loop.Run(); |
| 126 Mock::VerifyAndClearExpectations(&observer); | 126 Mock::VerifyAndClearExpectations(&observer); |
| 127 policy_manager()->core()->client()->RemoveObserver(&observer); | 127 policy_manager()->core()->client()->RemoveObserver(&observer); |
| 128 } | 128 } |
| 129 | 129 |
| 130 scoped_ptr<TestRequestInterceptor> interceptor_; | 130 scoped_ptr<TestRequestInterceptor> interceptor_; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, Register) { | 133 IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, Register) { |
| 134 // Accept one register request. The initial request should not include the | 134 // Accept one register request. The initial request should not include the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 const bool expect_reregister = true; | 184 const bool expect_reregister = true; |
| 185 interceptor_->PushJobCallback( | 185 interceptor_->PushJobCallback( |
| 186 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); | 186 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); |
| 187 | 187 |
| 188 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); | 188 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); |
| 189 ASSERT_NO_FATAL_FAILURE(Register()); | 189 ASSERT_NO_FATAL_FAILURE(Register()); |
| 190 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); | 190 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace policy | 193 } // namespace policy |
| OLD | NEW |