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