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

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

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work around STL android bug Created 6 years, 8 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/DEPS ('k') | chrome/browser/history/history_backend_unittest.cc » ('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 b80b25cf7f1a613c8f5eeacf1b99c956606b68e4..c29915cf437e7af8db0da3573f59d22ff73aae5a 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -18,6 +18,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
+#include "chrome/browser/bookmarks/test_bookmark_client.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/history/archived_database.h"
#include "chrome/browser/history/expire_history_backend.h"
@@ -56,12 +57,11 @@ class ExpireHistoryTest : public testing::Test,
public BroadcastNotificationDelegate {
public:
ExpireHistoryTest()
- : bookmark_model_(NULL, false),
+ : bookmark_model_(bookmark_client_.CreateModel(false)),
ui_thread_(BrowserThread::UI, &message_loop_),
db_thread_(BrowserThread::DB, &message_loop_),
- expirer_(this, &bookmark_model_),
- now_(Time::Now()) {
- }
+ expirer_(this, bookmark_model_.get()),
+ now_(Time::Now()) {}
protected:
// Called by individual tests when they want data populated.
@@ -90,8 +90,8 @@ class ExpireHistoryTest : public testing::Test,
}
void StarURL(const GURL& url) {
- bookmark_model_.AddURL(
- bookmark_model_.bookmark_bar_node(), 0, base::string16(), url);
+ bookmark_model_->AddURL(
+ bookmark_model_->bookmark_bar_node(), 0, base::string16(), url);
}
static bool IsStringInFile(const base::FilePath& filename, const char* str);
@@ -102,7 +102,8 @@ class ExpireHistoryTest : public testing::Test,
// This must be destroyed last.
base::ScopedTempDir tmp_dir_;
- BookmarkModel bookmark_model_;
+ test::TestBookmarkClient bookmark_client_;
+ scoped_ptr<BookmarkModel> bookmark_model_;
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
@@ -520,7 +521,7 @@ TEST_F(ExpireHistoryTest, DontDeleteStarredURL) {
// ASSERT_TRUE(HasThumbnail(url_row.id()));
// Unstar the URL and delete again.
- bookmark_utils::RemoveAllBookmarks(&bookmark_model_, url);
+ bookmark_utils::RemoveAllBookmarks(bookmark_model_.get(), url);
ClearLastNotifications();
expirer_.DeleteURL(url);
« no previous file with comments | « chrome/browser/history/DEPS ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698