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

Side by Side Diff: chrome/browser/history/top_sites_unittest.cc

Issue 10872032: Revert 152946 - Replace HistoryQuickProvider protobuf-based caching with an SQLite-based database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 TEST_F(TopSitesTest, CreateTopSitesThenHistory) { 1179 TEST_F(TopSitesTest, CreateTopSitesThenHistory) {
1180 profile()->DestroyTopSites(); 1180 profile()->DestroyTopSites();
1181 profile()->DestroyHistoryService(); 1181 profile()->DestroyHistoryService();
1182 1182
1183 // Remove the TopSites file. This forces TopSites to wait until history loads 1183 // Remove the TopSites file. This forces TopSites to wait until history loads
1184 // before TopSites is considered loaded. 1184 // before TopSites is considered loaded.
1185 file_util::Delete(profile()->GetPath().Append(chrome::kTopSitesFilename), 1185 file_util::Delete(profile()->GetPath().Append(chrome::kTopSitesFilename),
1186 false); 1186 false);
1187 1187
1188 // Create TopSites, but not History. 1188 // Create TopSites, but not History.
1189 HistoryServiceFactory::GetInstance()->SetTestingFactory(profile(), NULL);
1190 profile()->CreateTopSites(); 1189 profile()->CreateTopSites();
1191 WaitForTopSites(); 1190 WaitForTopSites();
1192 EXPECT_FALSE(IsTopSitesLoaded()); 1191 EXPECT_FALSE(IsTopSitesLoaded());
1193 1192
1194 // Load history, which should make TopSites finish loading too. 1193 // Load history, which should make TopSites finish loading too.
1195 profile()->CreateHistoryService(false, false); 1194 profile()->CreateHistoryService(false, false);
1196 profile()->BlockUntilTopSitesLoaded(); 1195 profile()->BlockUntilTopSitesLoaded();
1197 EXPECT_TRUE(IsTopSitesLoaded()); 1196 EXPECT_TRUE(IsTopSitesLoaded());
1198 } 1197 }
1199 1198
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 chrome::NOTIFICATION_TOP_SITES_LOADED, 1242 chrome::NOTIFICATION_TOP_SITES_LOADED,
1244 content::Source<Profile>(profile())); 1243 content::Source<Profile>(profile()));
1245 profile()->CreateTopSites(); 1244 profile()->CreateTopSites();
1246 HistoryServiceFactory::GetForProfile( 1245 HistoryServiceFactory::GetForProfile(
1247 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend(); 1246 profile(), Profile::EXPLICIT_ACCESS)->UnloadBackend();
1248 profile()->BlockUntilHistoryProcessesPendingRequests(); 1247 profile()->BlockUntilHistoryProcessesPendingRequests();
1249 observer.Wait(); 1248 observer.Wait();
1250 } 1249 }
1251 1250
1252 } // namespace history 1251 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/scored_history_match_unittest.cc ('k') | chrome/browser/history/url_index_private_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698