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

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

Issue 2403053003: Remove unused email from install attributes and add support for AD. (Closed)
Patch Set: Address Maksim's comments. Created 4 years, 2 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_store_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void SetUp() override { 57 void SetUp() override {
58 DeviceSettingsTestBase::SetUp(); 58 DeviceSettingsTestBase::SetUp();
59 59
60 dbus_setter_->SetCryptohomeClient( 60 dbus_setter_->SetCryptohomeClient(
61 std::unique_ptr<chromeos::CryptohomeClient>(fake_cryptohome_client_)); 61 std::unique_ptr<chromeos::CryptohomeClient>(fake_cryptohome_client_));
62 62
63 base::RunLoop loop; 63 base::RunLoop loop;
64 chromeos::InstallAttributes::LockResult result; 64 chromeos::InstallAttributes::LockResult result;
65 install_attributes_->LockDevice( 65 install_attributes_->LockDevice(
66 PolicyBuilder::kFakeUsername,
67 DEVICE_MODE_ENTERPRISE, 66 DEVICE_MODE_ENTERPRISE,
67 PolicyBuilder::kFakeDomain,
68 std::string(), // realm
68 PolicyBuilder::kFakeDeviceId, 69 PolicyBuilder::kFakeDeviceId,
69 base::Bind(&CopyLockResult, &loop, &result)); 70 base::Bind(&CopyLockResult, &loop, &result));
70 loop.Run(); 71 loop.Run();
71 ASSERT_EQ(chromeos::InstallAttributes::LOCK_SUCCESS, result); 72 ASSERT_EQ(chromeos::InstallAttributes::LOCK_SUCCESS, result);
72 } 73 }
73 74
74 void ExpectFailure(CloudPolicyStore::Status expected_status) { 75 void ExpectFailure(CloudPolicyStore::Status expected_status) {
75 EXPECT_EQ(expected_status, store_->status()); 76 EXPECT_EQ(expected_status, store_->status());
76 EXPECT_TRUE(store_->is_initialized()); 77 EXPECT_TRUE(store_->is_initialized());
77 EXPECT_FALSE(store_->has_policy()); 78 EXPECT_FALSE(store_->has_policy());
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 275
275 TEST_F(DeviceCloudPolicyStoreChromeOSTest, InstallInitialPolicyNotEnterprise) { 276 TEST_F(DeviceCloudPolicyStoreChromeOSTest, InstallInitialPolicyNotEnterprise) {
276 PrepareNewSigningKey(); 277 PrepareNewSigningKey();
277 ResetToNonEnterprise(); 278 ResetToNonEnterprise();
278 store_->InstallInitialPolicy(device_policy_.policy()); 279 store_->InstallInitialPolicy(device_policy_.policy());
279 FlushDeviceSettings(); 280 FlushDeviceSettings();
280 ExpectFailure(CloudPolicyStore::STATUS_BAD_STATE); 281 ExpectFailure(CloudPolicyStore::STATUS_BAD_STATE);
281 } 282 }
282 283
283 } // namespace policy 284 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698