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 "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( | 497 chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( |
498 profile_.get()); | 498 profile_.get()); |
499 ASSERT_TRUE(owner_settings_service); | 499 ASSERT_TRUE(owner_settings_service); |
500 | 500 |
501 EnrollmentConfig enrollment_config; | 501 EnrollmentConfig enrollment_config; |
502 enrollment_config.auth_mechanism = | 502 enrollment_config.auth_mechanism = |
503 EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE; | 503 EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE; |
504 enrollment_config.mode = with_cert ? EnrollmentConfig::MODE_ATTESTATION | 504 enrollment_config.mode = with_cert ? EnrollmentConfig::MODE_ATTESTATION |
505 : EnrollmentConfig::MODE_MANUAL; | 505 : EnrollmentConfig::MODE_MANUAL; |
506 std::string token = with_cert ? "" : "auth token"; | 506 std::string token = with_cert ? "" : "auth token"; |
507 initializer_->StartEnrollment( | 507 initializer_->PrepareEnrollment( |
508 &device_management_service_, nullptr, enrollment_config, token, | 508 &device_management_service_, nullptr, enrollment_config, token, |
509 base::Bind(&DeviceCloudPolicyManagerChromeOSEnrollmentTest::Done, | 509 base::Bind(&DeviceCloudPolicyManagerChromeOSEnrollmentTest::Done, |
510 base::Unretained(this))); | 510 base::Unretained(this))); |
| 511 initializer_->StartEnrollment(); |
511 base::RunLoop().RunUntilIdle(); | 512 base::RunLoop().RunUntilIdle(); |
512 Mock::VerifyAndClearExpectations(&device_management_service_); | 513 Mock::VerifyAndClearExpectations(&device_management_service_); |
513 AllowUninterestingRemoteCommandFetches(); | 514 AllowUninterestingRemoteCommandFetches(); |
514 | 515 |
515 if (done_) | 516 if (done_) |
516 return; | 517 return; |
517 | 518 |
518 // Process registration. | 519 // Process registration. |
519 ASSERT_TRUE(register_job); | 520 ASSERT_TRUE(register_job); |
520 MockDeviceManagementJob* policy_fetch_job = NULL; | 521 MockDeviceManagementJob* policy_fetch_job = NULL; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 DeviceCloudPolicyManagerChromeOSEnrollmentTest, | 839 DeviceCloudPolicyManagerChromeOSEnrollmentTest, |
839 ::testing::Values(false, true)); | 840 ::testing::Values(false, true)); |
840 | 841 |
841 INSTANTIATE_TEST_CASE_P( | 842 INSTANTIATE_TEST_CASE_P( |
842 Cert, | 843 Cert, |
843 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, | 844 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, |
844 ::testing::Values(false, true)); | 845 ::testing::Values(false, true)); |
845 | 846 |
846 } // namespace | 847 } // namespace |
847 } // namespace policy | 848 } // namespace policy |
OLD | NEW |