| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 // Key installation, policy load and refresh token save. | 356 // Key installation, policy load and refresh token save. |
| 357 device_settings_test_helper_.set_policy_blob(loaded_blob_); | 357 device_settings_test_helper_.set_policy_blob(loaded_blob_); |
| 358 owner_key_util_->SetPublicKeyFromPrivateKey( | 358 owner_key_util_->SetPublicKeyFromPrivateKey( |
| 359 *device_policy_.GetNewSigningKey()); | 359 *device_policy_.GetNewSigningKey()); |
| 360 ReloadDeviceSettings(); | 360 ReloadDeviceSettings(); |
| 361 | 361 |
| 362 if (done_) | 362 if (done_) |
| 363 return; | 363 return; |
| 364 | 364 |
| 365 chromeos::DeviceOAuth2TokenService* token_service = |
| 366 chromeos::DeviceOAuth2TokenServiceFactory::Get(); |
| 365 // Process robot refresh token store. | 367 // Process robot refresh token store. |
| 366 EXPECT_EQ( | 368 EXPECT_EQ( |
| 367 "refreshToken4Test", | 369 "refreshToken4Test", |
| 368 chromeos::DeviceOAuth2TokenServiceFactory::Get()->GetRefreshToken()); | 370 token_service->GetRefreshToken(token_service->GetRobotAccountId())); |
| 369 } | 371 } |
| 370 | 372 |
| 371 bool is_auto_enrollment_; | 373 bool is_auto_enrollment_; |
| 372 | 374 |
| 373 DeviceManagementStatus register_status_; | 375 DeviceManagementStatus register_status_; |
| 374 em::DeviceManagementResponse register_response_; | 376 em::DeviceManagementResponse register_response_; |
| 375 | 377 |
| 376 DeviceManagementStatus policy_fetch_status_; | 378 DeviceManagementStatus policy_fetch_status_; |
| 377 em::DeviceManagementResponse policy_fetch_response_; | 379 em::DeviceManagementResponse policy_fetch_response_; |
| 378 | 380 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, LoadError) { | 489 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, LoadError) { |
| 488 loaded_blob_.clear(); | 490 loaded_blob_.clear(); |
| 489 RunTest(); | 491 RunTest(); |
| 490 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR); | 492 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR); |
| 491 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR, | 493 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR, |
| 492 status_.store_status()); | 494 status_.store_status()); |
| 493 } | 495 } |
| 494 | 496 |
| 495 } // namespace | 497 } // namespace |
| 496 } // namespace policy | 498 } // namespace policy |
| OLD | NEW |