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

Unified Diff: chrome/browser/importer/importer_unittest.cc

Issue 6979007: Many fixes to bookmark importing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Happy tests =) Created 9 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/importer/importer_host.cc ('k') | chrome/browser/importer/in_process_importer_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/importer_unittest.cc
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 424f21eb1c33dffa70012b5fcd4d1c05a89c91e2..066c5ba867a82742db395964d773e356904506a4 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -153,10 +153,10 @@ bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry,
#if defined(OS_WIN)
static const BookmarkList kIEBookmarks[] = {
- {true, 0, {},
+ {true, 1, {L"Links"},
L"TheLink",
"http://www.links-thelink.com/"},
- {true, 1, {L"SubFolderOfLinks"},
+ {true, 2, {L"Links", L"SubFolderOfLinks"},
L"SubLink",
"http://www.links-sublink.com/"},
{false, 0, {},
@@ -238,12 +238,11 @@ class TestObserver : public ProfileWriter,
EXPECT_EQ(history::SOURCE_IE_IMPORTED, visit_source);
}
- virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark,
- const string16& first_folder_name,
- int options) OVERRIDE {
+ virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmarks,
+ const string16& top_level_folder_name) OVERRIDE {
// Importer should import the IE Favorites folder the same as the list.
- for (size_t i = 0; i < bookmark.size(); ++i) {
- if (FindBookmarkEntry(bookmark[i], kIEBookmarks,
+ for (size_t i = 0; i < bookmarks.size(); ++i) {
+ if (FindBookmarkEntry(bookmarks[i], kIEBookmarks,
arraysize(kIEBookmarks)))
++bookmark_count_;
}
@@ -465,10 +464,10 @@ TEST_F(ImporterTest, IE7Importer) {
#endif // defined(OS_WIN)
static const BookmarkList kFirefox2Bookmarks[] = {
- {true, 1, {L"Folder"},
+ {true, 2, {L"Bookmarks Toolbar Folder", L"Folder"},
L"On Toolbar's Subfolder",
"http://on.toolbar/bookmark/folder"},
- {true, 0, {},
+ {true, 1, {L"Bookmarks Toolbar Folder"},
L"On Bookmark Toolbar",
"http://on.toolbar/bookmark"},
{false, 1, {L"Folder"},
@@ -604,11 +603,10 @@ class FirefoxObserver : public ProfileWriter,
++history_count_;
}
- virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark,
- const string16& first_folder_name,
- int options) OVERRIDE {
- for (size_t i = 0; i < bookmark.size(); ++i) {
- if (FindBookmarkEntry(bookmark[i], kFirefox2Bookmarks,
+ virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmarks,
+ const string16& top_level_folder_name) OVERRIDE {
+ for (size_t i = 0; i < bookmarks.size(); ++i) {
+ if (FindBookmarkEntry(bookmarks[i], kFirefox2Bookmarks,
arraysize(kFirefox2Bookmarks)))
++bookmark_count_;
}
@@ -701,7 +699,7 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) {
}
static const BookmarkList kFirefox3Bookmarks[] = {
- {true, 0, {},
+ {true, 1, {L"Bookmarks Toolbar"},
L"Toolbar",
"http://site/"},
{false, 0, {},
@@ -814,11 +812,10 @@ class Firefox3Observer : public ProfileWriter,
++history_count_;
}
- virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmark,
- const string16& first_folder_name,
- int options) OVERRIDE {
- for (size_t i = 0; i < bookmark.size(); ++i) {
- if (FindBookmarkEntry(bookmark[i], kFirefox3Bookmarks,
+ virtual void AddBookmarks(const std::vector<BookmarkEntry>& bookmarks,
+ const string16& top_level_folder_name) OVERRIDE {
+ for (size_t i = 0; i < bookmarks.size(); ++i) {
+ if (FindBookmarkEntry(bookmarks[i], kFirefox3Bookmarks,
arraysize(kFirefox3Bookmarks)))
++bookmark_count_;
}
« no previous file with comments | « chrome/browser/importer/importer_host.cc ('k') | chrome/browser/importer/in_process_importer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698