OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/profile_signin_confirmation_helper.h" | 5 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 new syncable_prefs::TestingPrefServiceSyncable( | 137 new syncable_prefs::TestingPrefServiceSyncable( |
138 new TestingPrefStore(), user_prefs_, new TestingPrefStore(), | 138 new TestingPrefStore(), user_prefs_, new TestingPrefStore(), |
139 new user_prefs::PrefRegistrySyncable(), new PrefNotifierImpl()); | 139 new user_prefs::PrefRegistrySyncable(), new PrefNotifierImpl()); |
140 chrome::RegisterUserProfilePrefs(pref_service->registry()); | 140 chrome::RegisterUserProfilePrefs(pref_service->registry()); |
141 builder.SetPrefService( | 141 builder.SetPrefService( |
142 base::WrapUnique<syncable_prefs::PrefServiceSyncable>(pref_service)); | 142 base::WrapUnique<syncable_prefs::PrefServiceSyncable>(pref_service)); |
143 profile_ = builder.Build(); | 143 profile_ = builder.Build(); |
144 | 144 |
145 // Initialize the services we check. | 145 // Initialize the services we check. |
146 profile_->CreateBookmarkModel(true); | 146 profile_->CreateBookmarkModel(true); |
147 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); | 147 model_ = BookmarkModelFactory::GetForBrowserContext(profile_.get()); |
148 bookmarks::test::WaitForBookmarkModelToLoad(model_); | 148 bookmarks::test::WaitForBookmarkModelToLoad(model_); |
149 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); | 149 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); |
150 #if defined(ENABLE_EXTENSIONS) | 150 #if defined(ENABLE_EXTENSIONS) |
151 extensions::TestExtensionSystem* system = | 151 extensions::TestExtensionSystem* system = |
152 static_cast<extensions::TestExtensionSystem*>( | 152 static_cast<extensions::TestExtensionSystem*>( |
153 extensions::ExtensionSystem::Get(profile_.get())); | 153 extensions::ExtensionSystem::Get(profile_.get())); |
154 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 154 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
155 system->CreateExtensionService(&command_line, | 155 system->CreateExtensionService(&command_line, |
156 base::FilePath(kExtensionFilePath), | 156 base::FilePath(kExtensionFilePath), |
157 false); | 157 false); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { | 277 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { |
278 // Browser has been shut down since profile was created. | 278 // Browser has been shut down since profile was created. |
279 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); | 279 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); |
280 EXPECT_TRUE( | 280 EXPECT_TRUE( |
281 GetCallbackResult( | 281 GetCallbackResult( |
282 base::Bind( | 282 base::Bind( |
283 &ui::CheckShouldPromptForNewProfile, | 283 &ui::CheckShouldPromptForNewProfile, |
284 profile_.get()))); | 284 profile_.get()))); |
285 } | 285 } |
OLD | NEW |