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

Unified Diff: chrome/utility/importer/bookmark_html_reader_unittest.cc

Issue 1119453003: [Importer] Allow Chrome to import bookmark files without a charset specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/utility/importer/bookmark_html_reader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/bookmark_html_reader_unittest.cc
diff --git a/chrome/utility/importer/bookmark_html_reader_unittest.cc b/chrome/utility/importer/bookmark_html_reader_unittest.cc
index ac5fa86c488fdb4ee3ac042a3082099f91bcbbdc..4ab7267e4ba821a0dc50bbf28ede08ef32425203 100644
--- a/chrome/utility/importer/bookmark_html_reader_unittest.cc
+++ b/chrome/utility/importer/bookmark_html_reader_unittest.cc
@@ -340,6 +340,24 @@ TEST_F(BookmarkHTMLReaderTestWithData, FirefoxBookmarkFileWithKeywordImport) {
ExpectSecondFirefoxBookmarkWithKeyword(search_engines[1]);
}
+// Verifies that importing a bookmarks file without a charset specified succeeds
+// (by falling back to a default charset). Per [ http://crbug.com/460423 ], this
+// sort of bookmarks file is generated by IE.
+TEST_F(BookmarkHTMLReaderTestWithData,
+ InternetExplorerBookmarkFileWithoutCharsetImport) {
+ base::FilePath path = test_data_path_.AppendASCII("ie_sans_charset.html");
+
+ std::vector<ImportedBookmarkEntry> bookmarks;
+ ImportBookmarksFile(base::Callback<bool(void)>(),
+ base::Callback<bool(const GURL&)>(),
+ path, &bookmarks, NULL, NULL);
+
+ ASSERT_EQ(3U, bookmarks.size());
+ EXPECT_EQ(ASCIIToUTF16("Google"), bookmarks[0].title);
+ EXPECT_EQ(ASCIIToUTF16("Outlook"), bookmarks[1].title);
+ EXPECT_EQ(ASCIIToUTF16("Speed Test"), bookmarks[2].title);
+}
+
namespace {
class CancelAfterFifteenCalls {
« no previous file with comments | « chrome/utility/importer/bookmark_html_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698