Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_unittest.cc

Issue 17109006: Device robot refresh token integrity validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Extend device_oauth2_token_service_unittest.cc to cover refresh token validation cases. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.h" 10 #include "base/message_loop.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 POLICY_SCOPE_MACHINE, 149 POLICY_SCOPE_MACHINE,
150 Value::CreateBooleanValue(false)); 150 Value::CreateBooleanValue(false));
151 EXPECT_TRUE(manager_.policies().Equals(bundle)); 151 EXPECT_TRUE(manager_.policies().Equals(bundle));
152 152
153 manager_.Connect(&local_state_, &device_management_service_, 153 manager_.Connect(&local_state_, &device_management_service_,
154 scoped_ptr<CloudPolicyClient::StatusProvider>(NULL)); 154 scoped_ptr<CloudPolicyClient::StatusProvider>(NULL));
155 EXPECT_TRUE(manager_.policies().Equals(bundle)); 155 EXPECT_TRUE(manager_.policies().Equals(bundle));
156 156
157 manager_.Shutdown(); 157 manager_.Shutdown();
158 EXPECT_TRUE(manager_.policies().Equals(bundle)); 158 EXPECT_TRUE(manager_.policies().Equals(bundle));
159
160 EXPECT_EQ(manager_.GetRobotAccountId(),
161 PolicyBuilder::kFakeServiceAccountIdentity);
159 } 162 }
160 163
161 TEST_F(DeviceCloudPolicyManagerChromeOSTest, ConsumerDevice) { 164 TEST_F(DeviceCloudPolicyManagerChromeOSTest, ConsumerDevice) {
162 FlushDeviceSettings(); 165 FlushDeviceSettings();
163 EXPECT_EQ(CloudPolicyStore::STATUS_BAD_STATE, store_->status()); 166 EXPECT_EQ(CloudPolicyStore::STATUS_BAD_STATE, store_->status());
164 EXPECT_TRUE(manager_.IsInitializationComplete(POLICY_DOMAIN_CHROME)); 167 EXPECT_TRUE(manager_.IsInitializationComplete(POLICY_DOMAIN_CHROME));
165 168
166 PolicyBundle bundle; 169 PolicyBundle bundle;
167 EXPECT_TRUE(manager_.policies().Equals(bundle)); 170 EXPECT_TRUE(manager_.policies().Equals(bundle));
168 171
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, LoadError) { 478 TEST_F(DeviceCloudPolicyManagerChromeOSEnrollmentTest, LoadError) {
476 loaded_blob_.clear(); 479 loaded_blob_.clear();
477 RunTest(); 480 RunTest();
478 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR); 481 ExpectFailedEnrollment(EnrollmentStatus::STATUS_STORE_ERROR);
479 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR, 482 EXPECT_EQ(CloudPolicyStore::STATUS_LOAD_ERROR,
480 status_.store_status()); 483 status_.store_status());
481 } 484 }
482 485
483 } // namespace test 486 } // namespace test
484 } // namespace policy 487 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698