| Index: chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
|
| diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
|
| index f99071840713a62c286c84ea3e32468502c1dbae..3fbb8f0c258bf2d044a6b483c48fba57d0215e5d 100644
|
| --- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
|
| +++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
|
| @@ -13,13 +13,15 @@
|
| #include "base/string_util.h"
|
| #include "base/time.h"
|
| #include "base/utf_string_conversions.h"
|
| +#include "chrome/browser/bookmarks/bookmark_html_reader.h"
|
| #include "chrome/browser/bookmarks/bookmark_model.h"
|
| #include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
| +#include "chrome/browser/bookmarks/imported_bookmark_entry.h"
|
| #include "chrome/browser/favicon/favicon_service.h"
|
| #include "chrome/browser/favicon/favicon_service_factory.h"
|
| +#include "chrome/browser/favicon/imported_favicon_usage.h"
|
| #include "chrome/browser/history/history_service.h"
|
| #include "chrome/browser/history/history_service_factory.h"
|
| -#include "chrome/browser/importer/firefox2_importer.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/public/test/test_browser_thread.h"
|
| @@ -56,8 +58,9 @@ class BookmarkHTMLWriterTest : public testing::Test {
|
| path_ = temp_dir_.path().AppendASCII("bookmarks.html");
|
| }
|
|
|
| - // Converts a BookmarkEntry to a string suitable for assertion testing.
|
| - string16 BookmarkEntryToString(const ProfileWriter::BookmarkEntry& entry) {
|
| + // Converts an ImportedBookmarkEntry to a string suitable for assertion
|
| + // testing.
|
| + string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) {
|
| string16 result;
|
| result.append(ASCIIToUTF16("on_toolbar="));
|
| if (entry.in_toolbar)
|
| @@ -90,7 +93,7 @@ class BookmarkHTMLWriterTest : public testing::Test {
|
| const string16& f1,
|
| const string16& f2,
|
| const string16& f3) {
|
| - ProfileWriter::BookmarkEntry entry;
|
| + ImportedBookmarkEntry entry;
|
| entry.in_toolbar = on_toolbar;
|
| entry.url = url;
|
| if (!f1.empty()) {
|
| @@ -106,7 +109,7 @@ class BookmarkHTMLWriterTest : public testing::Test {
|
| return BookmarkEntryToString(entry);
|
| }
|
|
|
| - void AssertBookmarkEntryEquals(const ProfileWriter::BookmarkEntry& entry,
|
| + void AssertBookmarkEntryEquals(const ImportedBookmarkEntry& entry,
|
| bool on_toolbar,
|
| const GURL& url,
|
| const string16& title,
|
| @@ -178,7 +181,7 @@ TEST_F(BookmarkHTMLWriterTest, Test) {
|
| // url1
|
| // Mobile
|
| // url1
|
| - // <bookmark without a title. Not supported by Firefox 2 import>
|
| + // <bookmark without a title.>
|
| string16 f1_title = ASCIIToUTF16("F\"&;<1\"");
|
| string16 f2_title = ASCIIToUTF16("F2");
|
| string16 f3_title = ASCIIToUTF16("F 3");
|
| @@ -236,14 +239,13 @@ TEST_F(BookmarkHTMLWriterTest, Test) {
|
| message_loop.RunUntilIdle();
|
|
|
| // Read the bookmarks back in.
|
| - std::vector<ProfileWriter::BookmarkEntry> parsed_bookmarks;
|
| - std::vector<history::ImportedFaviconUsage> favicons;
|
| - Firefox2Importer::ImportBookmarksFile(path_,
|
| - std::set<GURL>(),
|
| - NULL,
|
| - &parsed_bookmarks,
|
| - NULL,
|
| - &favicons);
|
| + std::vector<ImportedBookmarkEntry> parsed_bookmarks;
|
| + std::vector<ImportedFaviconUsage> favicons;
|
| + bookmark_html_reader::ImportBookmarksFile(NULL,
|
| + NULL,
|
| + path_,
|
| + &parsed_bookmarks,
|
| + &favicons);
|
|
|
| // Check loaded favicon (url1 is represented by 4 separate bookmarks).
|
| EXPECT_EQ(4U, favicons.size());
|
| @@ -258,7 +260,7 @@ TEST_F(BookmarkHTMLWriterTest, Test) {
|
| }
|
|
|
| // Verify we got back what we wrote.
|
| - ASSERT_EQ(8U, parsed_bookmarks.size());
|
| + ASSERT_EQ(9U, parsed_bookmarks.size());
|
| // Windows and ChromeOS builds use Sentence case.
|
| string16 bookmark_folder_name =
|
| l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_FOLDER_NAME);
|
| @@ -278,4 +280,7 @@ TEST_F(BookmarkHTMLWriterTest, Test) {
|
| f3_title, f4_title, string16());
|
| AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1,
|
| string16(), string16(), string16());
|
| + AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url,
|
| + unnamed_bookmark_title, t2,
|
| + string16(), string16(), string16());
|
| }
|
|
|