| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 : user_prefs_(NULL), | 129 : user_prefs_(NULL), |
| 130 model_(NULL) { | 130 model_(NULL) { |
| 131 } | 131 } |
| 132 | 132 |
| 133 void SetUp() override { | 133 void SetUp() override { |
| 134 // Create the profile. | 134 // Create the profile. |
| 135 TestingProfile::Builder builder; | 135 TestingProfile::Builder builder; |
| 136 user_prefs_ = new TestingPrefStoreWithCustomReadError; | 136 user_prefs_ = new TestingPrefStoreWithCustomReadError; |
| 137 sync_preferences::TestingPrefServiceSyncable* pref_service = | 137 sync_preferences::TestingPrefServiceSyncable* pref_service = |
| 138 new sync_preferences::TestingPrefServiceSyncable( | 138 new sync_preferences::TestingPrefServiceSyncable( |
| 139 new TestingPrefStore(), user_prefs_, new TestingPrefStore(), | 139 new TestingPrefStore(), new TestingPrefStore(), user_prefs_, |
| 140 new user_prefs::PrefRegistrySyncable(), new PrefNotifierImpl()); | 140 new TestingPrefStore(), new user_prefs::PrefRegistrySyncable(), |
| 141 new PrefNotifierImpl()); |
| 141 chrome::RegisterUserProfilePrefs(pref_service->registry()); | 142 chrome::RegisterUserProfilePrefs(pref_service->registry()); |
| 142 builder.SetPrefService( | 143 builder.SetPrefService( |
| 143 base::WrapUnique<sync_preferences::PrefServiceSyncable>(pref_service)); | 144 base::WrapUnique<sync_preferences::PrefServiceSyncable>(pref_service)); |
| 144 profile_ = builder.Build(); | 145 profile_ = builder.Build(); |
| 145 | 146 |
| 146 // Initialize the services we check. | 147 // Initialize the services we check. |
| 147 profile_->CreateBookmarkModel(true); | 148 profile_->CreateBookmarkModel(true); |
| 148 model_ = BookmarkModelFactory::GetForBrowserContext(profile_.get()); | 149 model_ = BookmarkModelFactory::GetForBrowserContext(profile_.get()); |
| 149 bookmarks::test::WaitForBookmarkModelToLoad(model_); | 150 bookmarks::test::WaitForBookmarkModelToLoad(model_); |
| 150 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); | 151 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 278 |
| 278 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { | 279 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { |
| 279 // Browser has been shut down since profile was created. | 280 // Browser has been shut down since profile was created. |
| 280 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); | 281 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); |
| 281 EXPECT_TRUE( | 282 EXPECT_TRUE( |
| 282 GetCallbackResult( | 283 GetCallbackResult( |
| 283 base::Bind( | 284 base::Bind( |
| 284 &ui::CheckShouldPromptForNewProfile, | 285 &ui::CheckShouldPromptForNewProfile, |
| 285 profile_.get()))); | 286 profile_.get()))); |
| 286 } | 287 } |
| OLD | NEW |