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