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

Unified Diff: chrome/browser/history/expire_history_backend_unittest.cc

Issue 285233012: Abstract history dependencies on bookmarks through HistoryClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android unit tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/expire_history_backend.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/expire_history_backend_unittest.cc
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc
index feab73246d8d585d223ff06aae184ab1d4ace419..ab3112f574d2c7ae020bfd727723cb430d417511 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -29,6 +29,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/test/test_bookmark_client.h"
+#include "components/history/core/test/history_client_fake_bookmarks.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -57,10 +58,9 @@ class ExpireHistoryTest : public testing::Test,
public BroadcastNotificationDelegate {
public:
ExpireHistoryTest()
- : bookmark_model_(bookmark_client_.CreateModel(false)),
- ui_thread_(BrowserThread::UI, &message_loop_),
+ : ui_thread_(BrowserThread::UI, &message_loop_),
db_thread_(BrowserThread::DB, &message_loop_),
- expirer_(this, bookmark_model_.get()),
+ expirer_(this, &history_client_),
now_(Time::Now()) {}
protected:
@@ -89,10 +89,7 @@ class ExpireHistoryTest : public testing::Test,
STLDeleteValues(&notifications_);
}
- void StarURL(const GURL& url) {
- bookmark_model_->AddURL(
- bookmark_model_->bookmark_bar_node(), 0, base::string16(), url);
- }
+ void StarURL(const GURL& url) { history_client_.AddBookmark(url); }
static bool IsStringInFile(const base::FilePath& filename, const char* str);
@@ -102,8 +99,7 @@ class ExpireHistoryTest : public testing::Test,
// This must be destroyed last.
base::ScopedTempDir tmp_dir_;
- test::TestBookmarkClient bookmark_client_;
- scoped_ptr<BookmarkModel> bookmark_model_;
+ HistoryClientFakeBookmarks history_client_;
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
@@ -521,7 +517,7 @@ TEST_F(ExpireHistoryTest, DontDeleteStarredURL) {
// ASSERT_TRUE(HasThumbnail(url_row.id()));
// Unstar the URL and delete again.
- bookmark_utils::RemoveAllBookmarks(bookmark_model_.get(), url);
+ history_client_.ClearAllBookmarks();
ClearLastNotifications();
expirer_.DeleteURL(url);
« no previous file with comments | « chrome/browser/history/expire_history_backend.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698