| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/signin/signin_create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/prefs/browser_prefs.h" | 8 #include "chrome/browser/prefs/browser_prefs.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_attributes_entry.h" | |
| 11 #include "chrome/browser/profiles/profile_attributes_storage.h" | |
| 12 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 13 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 11 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 14 #include "chrome/browser/signin/signin_error_controller_factory.h" | 12 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 15 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 16 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" | 14 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" |
| 17 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" | 15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac
tory.h" |
| 18 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
| 20 #include "chrome/test/base/browser_with_test_window_test.h" | 18 #include "chrome/test/base/browser_with_test_window_test.h" |
| 21 #include "chrome/test/base/testing_browser_process.h" | 19 #include "chrome/test/base/testing_browser_process.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 204 |
| 207 // The second supervised user exists on the device. | 205 // The second supervised user exists on the device. |
| 208 profile_manager()->CreateTestingProfile( | 206 profile_manager()->CreateTestingProfile( |
| 209 kSupervisedUsername2, | 207 kSupervisedUsername2, |
| 210 std::unique_ptr<syncable_prefs::PrefServiceSyncable>(), | 208 std::unique_ptr<syncable_prefs::PrefServiceSyncable>(), |
| 211 base::UTF8ToUTF16(kSupervisedUsername2), | 209 base::UTF8ToUTF16(kSupervisedUsername2), |
| 212 0, | 210 0, |
| 213 kSupervisedUserId2, // supervised_user_id | 211 kSupervisedUserId2, // supervised_user_id |
| 214 TestingProfile::TestingFactories()); | 212 TestingProfile::TestingFactories()); |
| 215 | 213 |
| 216 EXPECT_EQ(2u, | 214 const ProfileInfoCache* cache = profile_manager_->profile_info_cache(); |
| 217 profile_manager()->profile_attributes_storage()->GetNumberOfProfiles()); | 215 EXPECT_EQ(2u, cache->GetNumberOfProfiles()); |
| 218 } | 216 } |
| 219 | 217 |
| 220 void TearDown() override { | 218 void TearDown() override { |
| 221 profile_manager_.reset(); | 219 profile_manager_.reset(); |
| 222 handler_.reset(); | 220 handler_.reset(); |
| 223 BrowserWithTestWindowTest::TearDown(); | 221 BrowserWithTestWindowTest::TearDown(); |
| 224 } | 222 } |
| 225 | 223 |
| 226 content::TestWebUI* web_ui() { | 224 content::TestWebUI* web_ui() { |
| 227 return web_ui_.get(); | 225 return web_ui_.get(); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0))); | 571 list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0))); |
| 574 list_args.Append(new base::FundamentalValue(false)); // create_shortcut | 572 list_args.Append(new base::FundamentalValue(false)); // create_shortcut |
| 575 list_args.Append(new base::FundamentalValue(true)); // is_supervised | 573 list_args.Append(new base::FundamentalValue(true)); // is_supervised |
| 576 list_args.Append(new base::StringValue("")); // supervised_user_id | 574 list_args.Append(new base::StringValue("")); // supervised_user_id |
| 577 list_args.Append(new base::StringValue(custodian()->GetPath().value())); | 575 list_args.Append(new base::StringValue(custodian()->GetPath().value())); |
| 578 handler()->CreateProfile(&list_args); | 576 handler()->CreateProfile(&list_args); |
| 579 | 577 |
| 580 // Expect nothing to happen. | 578 // Expect nothing to happen. |
| 581 EXPECT_EQ(0U, web_ui()->call_data().size()); | 579 EXPECT_EQ(0U, web_ui()->call_data().size()); |
| 582 } | 580 } |
| OLD | NEW |