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

Side by Side Diff: chrome/browser/history/android/android_provider_backend_unittest.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Eliminate Profile::FromBrowserContext in some places Created 4 years, 4 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/history/android/android_provider_backend.h" 5 #include "chrome/browser/history/android/android_provider_backend.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 protected: 178 protected:
179 void SetUp() override { 179 void SetUp() override {
180 // Setup the testing profile, so the bookmark_model_sql_handler could 180 // Setup the testing profile, so the bookmark_model_sql_handler could
181 // get the bookmark model from it. 181 // get the bookmark model from it.
182 ASSERT_TRUE(profile_manager_.SetUp()); 182 ASSERT_TRUE(profile_manager_.SetUp());
183 // It seems that the name has to be chrome::kInitialProfile, so it 183 // It seems that the name has to be chrome::kInitialProfile, so it
184 // could be found by ProfileManager::GetLastUsedProfile(). 184 // could be found by ProfileManager::GetLastUsedProfile().
185 TestingProfile* testing_profile = profile_manager_.CreateTestingProfile( 185 TestingProfile* testing_profile = profile_manager_.CreateTestingProfile(
186 chrome::kInitialProfile); 186 chrome::kInitialProfile);
187 testing_profile->CreateBookmarkModel(true); 187 testing_profile->CreateBookmarkModel(true);
188 bookmark_model_ = BookmarkModelFactory::GetForProfile(testing_profile); 188 bookmark_model_ =
189 BookmarkModelFactory::GetForBrowserContext(testing_profile);
189 history_client_.reset(new ChromeHistoryClient(bookmark_model_)); 190 history_client_.reset(new ChromeHistoryClient(bookmark_model_));
190 history_backend_client_ = history_client_->CreateBackendClient(); 191 history_backend_client_ = history_client_->CreateBackendClient();
191 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_); 192 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_);
192 ASSERT_TRUE(bookmark_model_); 193 ASSERT_TRUE(bookmark_model_);
193 194
194 // Get the BookmarkModel from LastUsedProfile, this is the same way that 195 // Get the BookmarkModel from LastUsedProfile, this is the same way that
195 // how the BookmarkModelSQLHandler gets the BookmarkModel. 196 // how the BookmarkModelSQLHandler gets the BookmarkModel.
196 Profile* profile = ProfileManager::GetLastUsedProfile(); 197 Profile* profile = ProfileManager::GetLastUsedProfile();
197 ASSERT_TRUE(profile); 198 ASSERT_TRUE(profile);
198 199
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 update_args, &update_count)); 2092 update_args, &update_count));
2092 // Verify notifications. 2093 // Verify notifications.
2093 EXPECT_FALSE(notifier_.deleted_details()); 2094 EXPECT_FALSE(notifier_.deleted_details());
2094 ASSERT_TRUE(notifier_.modified_details()); 2095 ASSERT_TRUE(notifier_.modified_details());
2095 ASSERT_EQ(1u, notifier_.modified_details()->size()); 2096 ASSERT_EQ(1u, notifier_.modified_details()->size());
2096 // No favicon will be updated as thumbnail database is missing. 2097 // No favicon will be updated as thumbnail database is missing.
2097 EXPECT_FALSE(notifier_.favicon_changed()); 2098 EXPECT_FALSE(notifier_.favicon_changed());
2098 } 2099 }
2099 2100
2100 } // namespace history 2101 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698