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

Side by Side Diff: chrome/browser/chromeos/policy/consumer_enrollment_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_enrollment_handler.h" 5 #include "chrome/browser/chromeos/policy/consumer_enrollment_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Inject fake objects. 56 // Inject fake objects.
57 BrowserPolicyConnectorChromeOS* connector = 57 BrowserPolicyConnectorChromeOS* connector =
58 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 58 g_browser_process->platform_part()->browser_policy_connector_chromeos();
59 connector->SetConsumerManagementServiceForTesting( 59 connector->SetConsumerManagementServiceForTesting(
60 make_scoped_ptr(fake_service_)); 60 make_scoped_ptr(fake_service_));
61 connector->SetDeviceCloudPolicyInitializerForTesting( 61 connector->SetDeviceCloudPolicyInitializerForTesting(
62 make_scoped_ptr(fake_initializer_)); 62 make_scoped_ptr(fake_initializer_));
63 63
64 // Set up FakeChromeUserManager. 64 // Set up FakeChromeUserManager.
65 fake_user_manager_->AddUser(kTestOwner); 65 fake_user_manager_->AddUser(AccountId::FromUserEmail(kTestOwner));
66 fake_user_manager_->AddUser(kTestUser); 66 fake_user_manager_->AddUser(AccountId::FromUserEmail(kTestUser));
67 fake_user_manager_->set_owner_email(kTestOwner); 67 fake_user_manager_->set_owner_id(AccountId::FromUserEmail(kTestOwner));
68 } 68 }
69 69
70 void SetUp() override { 70 void SetUp() override {
71 ASSERT_TRUE(testing_profile_manager_->SetUp()); 71 ASSERT_TRUE(testing_profile_manager_->SetUp());
72 TestingProfile::TestingFactories factories; 72 TestingProfile::TestingFactories factories;
73 factories.push_back( 73 factories.push_back(
74 std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(), 74 std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(),
75 BuildAutoIssuingFakeProfileOAuth2TokenService)); 75 BuildAutoIssuingFakeProfileOAuth2TokenService));
76 profile_ = testing_profile_manager_->CreateTestingProfile( 76 profile_ = testing_profile_manager_->CreateTestingProfile(
77 kTestUser, scoped_ptr<syncable_prefs::PrefServiceSyncable>(), 77 kTestUser, scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 EnrollmentStatus::STATUS_REGISTRATION_FAILED)); 147 EnrollmentStatus::STATUS_REGISTRATION_FAILED));
148 148
149 RunEnrollmentTest(); 149 RunEnrollmentTest();
150 150
151 EXPECT_TRUE(fake_initializer_->was_start_enrollment_called()); 151 EXPECT_TRUE(fake_initializer_->was_start_enrollment_called());
152 EXPECT_EQ(ConsumerManagementStage::EnrollmentDMServerFailed(), 152 EXPECT_EQ(ConsumerManagementStage::EnrollmentDMServerFailed(),
153 fake_service_->GetStage()); 153 fake_service_->GetStage());
154 } 154 }
155 155
156 } // namespace policy 156 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698