| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 arg3->response_data = response_data.SerializeAsString(); | 58 arg3->response_data = response_data.SerializeAsString(); |
| 59 arg3->response_code = http_error_code; | 59 arg3->response_code = http_error_code; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // An action that returns an URLRequestJob with a successful device | 62 // An action that returns an URLRequestJob with a successful device |
| 63 // registration response. | 63 // registration response. |
| 64 ACTION_P(CreateSuccessfulRegisterResponse, token) { | 64 ACTION_P(CreateSuccessfulRegisterResponse, token) { |
| 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 66 em::DeviceManagementResponse response_data; | 66 em::DeviceManagementResponse response_data; |
| 67 response_data.mutable_register_response()->set_device_management_token(token); | 67 response_data.mutable_register_response()->set_device_management_token(token); |
| 68 response_data.mutable_register_response()->set_enrollment_type( |
| 69 em::DeviceRegisterResponse::ENTERPRISE); |
| 68 | 70 |
| 69 arg3->response_data = response_data.SerializeAsString(); | 71 arg3->response_data = response_data.SerializeAsString(); |
| 70 arg3->response_code = 200; | 72 arg3->response_code = 200; |
| 71 } | 73 } |
| 72 | 74 |
| 73 // An action that returns an URLRequestJob with a successful policy response. | 75 // An action that returns an URLRequestJob with a successful policy response. |
| 74 ACTION_P3(CreateSuccessfulPolicyResponse, | 76 ACTION_P3(CreateSuccessfulPolicyResponse, |
| 75 homepage_location, | 77 homepage_location, |
| 76 set_serial_valid, | 78 set_serial_valid, |
| 77 serial_valid) { | 79 serial_valid) { |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { | 460 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { |
| 459 InSequence s; | 461 InSequence s; |
| 460 ExpectSuccessfulRegistration(); | 462 ExpectSuccessfulRegistration(); |
| 461 ExpectPolicyRequest("", true, true); | 463 ExpectPolicyRequest("", true, true); |
| 462 ExpectPolicyRequest(kMachineId, false, false); | 464 ExpectPolicyRequest(kMachineId, false, false); |
| 463 ExpectPolicyRequest("", false, false); | 465 ExpectPolicyRequest("", false, false); |
| 464 ExecuteTest(); | 466 ExecuteTest(); |
| 465 } | 467 } |
| 466 | 468 |
| 467 } // policy | 469 } // policy |
| OLD | NEW |