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

Unified Diff: chrome/browser/bookmarks/bookmark_index_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/bookmarks/bookmark_index.cc ('k') | chrome/browser/bookmarks/bookmark_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_index_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_index_unittest.cc b/chrome/browser/bookmarks/bookmark_index_unittest.cc
index 557e1a271f1d9507e96f8694ec52638e3a5bcbee..61191b97466f4aa5623a3ce6e39da329fa78b94e 100644
--- a/chrome/browser/bookmarks/bookmark_index_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_index_unittest.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/bookmark_test_helpers.h"
+#include "chrome/browser/bookmarks/test_bookmark_client.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/url_database.h"
@@ -27,8 +28,7 @@ using base::ASCIIToUTF16;
class BookmarkIndexTest : public testing::Test {
public:
- BookmarkIndexTest() : model_(new BookmarkModel(NULL, false)) {
- }
+ BookmarkIndexTest() : model_(client_.CreateModel(false)) {}
typedef std::pair<std::string, std::string> TitleAndURL;
@@ -105,6 +105,7 @@ class BookmarkIndexTest : public testing::Test {
}
protected:
+ test::TestBookmarkClient client_;
scoped_ptr<BookmarkModel> model_;
private:
@@ -161,7 +162,7 @@ TEST_F(BookmarkIndexTest, GetBookmarksMatching) {
ExpectMatches(data[i].query, expected);
- model_.reset(new BookmarkModel(NULL, false));
+ model_ = client_.CreateModel(false);
}
}
@@ -210,7 +211,7 @@ TEST_F(BookmarkIndexTest, GetBookmarksMatchingWithURLs) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- model_.reset(new BookmarkModel(NULL, true));
+ model_ = client_.CreateModel(true);
std::vector<TitleAndURL> bookmarks;
bookmarks.push_back(TitleAndURL(data[i].title, data[i].url));
AddBookmarks(bookmarks);
@@ -249,7 +250,7 @@ TEST_F(BookmarkIndexTest, Normalization) {
model_->GetBookmarksMatching(
base::UTF8ToUTF16(data[i].query), 10, &matches);
EXPECT_EQ(1u, matches.size());
- model_.reset(new BookmarkModel(NULL, false));
+ model_ = client_.CreateModel(false);
}
}
@@ -286,7 +287,7 @@ TEST_F(BookmarkIndexTest, MatchPositionsTitles) {
ExpectMatchPositions(matches[0].title_match_positions,
expected_title_matches);
- model_.reset(new BookmarkModel(NULL, false));
+ model_ = client_.CreateModel(false);
}
}
@@ -313,7 +314,7 @@ TEST_F(BookmarkIndexTest, MatchPositionsURLs) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- model_.reset(new BookmarkModel(NULL, true));
+ model_ = client_.CreateModel(true);
std::vector<TitleAndURL> bookmarks;
TitleAndURL bookmark("123456", data[i].url);
bookmarks.push_back(bookmark);
« no previous file with comments | « chrome/browser/bookmarks/bookmark_index.cc ('k') | chrome/browser/bookmarks/bookmark_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698