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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_provider_unittest.cc

Issue 872313005: Remove dependency on visitedlink from history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@init-prefs
Patch Set: Rebase Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/history/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autocomplete/shortcuts_provider.h" 5 #include "chrome/browser/autocomplete/shortcuts_provider.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 ASSERT_TRUE(backend_.get()); 307 ASSERT_TRUE(backend_.get());
308 ASSERT_TRUE(profile_.CreateHistoryService(true, false)); 308 ASSERT_TRUE(profile_.CreateHistoryService(true, false));
309 provider_ = new ShortcutsProvider(&profile_); 309 provider_ = new ShortcutsProvider(&profile_);
310 FillData(shortcut_test_db, arraysize(shortcut_test_db)); 310 FillData(shortcut_test_db, arraysize(shortcut_test_db));
311 } 311 }
312 312
313 void ShortcutsProviderTest::TearDown() { 313 void ShortcutsProviderTest::TearDown() {
314 // Run all pending tasks or else some threads hold on to the message loop 314 // Run all pending tasks or else some threads hold on to the message loop
315 // and prevent it from being deleted. 315 // and prevent it from being deleted.
316 message_loop_.RunUntilIdle(); 316 message_loop_.RunUntilIdle();
317 profile_.DestroyHistoryService();
317 provider_ = NULL; 318 provider_ = NULL;
318 } 319 }
319 320
320 void ShortcutsProviderTest::FillData(TestShortcutInfo* db, size_t db_size) { 321 void ShortcutsProviderTest::FillData(TestShortcutInfo* db, size_t db_size) {
321 DCHECK(provider_.get()); 322 DCHECK(provider_.get());
322 size_t expected_size = backend_->shortcuts_map().size() + db_size; 323 size_t expected_size = backend_->shortcuts_map().size() + db_size;
323 for (size_t i = 0; i < db_size; ++i) { 324 for (size_t i = 0; i < db_size; ++i) {
324 const TestShortcutInfo& cur = db[i]; 325 const TestShortcutInfo& cur = db[i];
325 history::ShortcutsDatabase::Shortcut shortcut( 326 history::ShortcutsDatabase::Shortcut shortcut(
326 cur.guid, ASCIIToUTF16(cur.text), 327 cur.guid, ASCIIToUTF16(cur.text),
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); 855 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL);
855 content::NotificationService::current()->Notify( 856 content::NotificationService::current()->Notify(
856 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, 857 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
857 content::Source<Profile>(&profile_), 858 content::Source<Profile>(&profile_),
858 content::Details<extensions::UnloadedExtensionInfo>(&details)); 859 content::Details<extensions::UnloadedExtensionInfo>(&details));
859 860
860 // Now the URL should have disappeared. 861 // Now the URL should have disappeared.
861 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); 862 RunTest(text, false, ExpectedURLs(), std::string(), base::string16());
862 } 863 }
863 #endif 864 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698