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

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

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/consumer_unenrollment_handler.h" 5 #include "chrome/browser/chromeos/policy/consumer_unenrollment_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 26 matching lines...) Expand all
37 fake_service_->SetStatusAndStage( 37 fake_service_->SetStatusAndStage(
38 ConsumerManagementService::STATUS_ENROLLED, 38 ConsumerManagementService::STATUS_ENROLLED,
39 ConsumerManagementStage::None()); 39 ConsumerManagementStage::None());
40 } 40 }
41 41
42 void SetUp() override { 42 void SetUp() override {
43 DeviceSettingsTestBase::SetUp(); 43 DeviceSettingsTestBase::SetUp();
44 44
45 // Set up the ownership, so that we can modify device settings. 45 // Set up the ownership, so that we can modify device settings.
46 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey()); 46 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey());
47 InitOwner(device_policy_.policy_data().username(), true); 47 InitOwner(AccountId::FromUserEmail(device_policy_.policy_data().username()),
48 true);
48 FlushDeviceSettings(); 49 FlushDeviceSettings();
49 50
50 51
51 // Set up FakeDeviceCloudPolicyManager. 52 // Set up FakeDeviceCloudPolicyManager.
52 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store_( 53 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store_(
53 new DeviceCloudPolicyStoreChromeOS( 54 new DeviceCloudPolicyStoreChromeOS(
54 &device_settings_service_, 55 &device_settings_service_,
55 install_attributes_.get(), 56 install_attributes_.get(),
56 base::ThreadTaskRunnerHandle::Get())); 57 base::ThreadTaskRunnerHandle::Get()));
57 fake_manager_.reset(new FakeDeviceCloudPolicyManager( 58 fake_manager_.reset(new FakeDeviceCloudPolicyManager(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 EXPECT_EQ(ConsumerManagementStage::UnenrollmentDMServerFailed(), 119 EXPECT_EQ(ConsumerManagementStage::UnenrollmentDMServerFailed(),
119 fake_service_->GetStage()); 120 fake_service_->GetStage());
120 const chromeos::OwnerSettingsServiceChromeOS::ManagementSettings& settings = 121 const chromeos::OwnerSettingsServiceChromeOS::ManagementSettings& settings =
121 fake_owner_settings_service_->last_settings(); 122 fake_owner_settings_service_->last_settings();
122 EXPECT_EQ(policy::MANAGEMENT_MODE_CONSUMER_MANAGED, settings.management_mode); 123 EXPECT_EQ(policy::MANAGEMENT_MODE_CONSUMER_MANAGED, settings.management_mode);
123 EXPECT_EQ("fake_request_token", settings.request_token); 124 EXPECT_EQ("fake_request_token", settings.request_token);
124 EXPECT_EQ("fake_device_id", settings.device_id); 125 EXPECT_EQ("fake_device_id", settings.device_id);
125 } 126 }
126 127
127 } // namespace policy 128 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698