| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/utility/importer/bookmark_html_reader.h" | 5 #include "chrome/utility/importer/bookmark_html_reader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 charset, &title, &url); | 134 charset, &title, &url); |
| 135 EXPECT_TRUE(result); | 135 EXPECT_TRUE(result); |
| 136 EXPECT_EQ(ASCIIToUTF16("Google"), title); | 136 EXPECT_EQ(ASCIIToUTF16("Google"), title); |
| 137 EXPECT_EQ("http://www.google.com/", url.spec()); | 137 EXPECT_EQ("http://www.google.com/", url.spec()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 namespace { | 140 namespace { |
| 141 | 141 |
| 142 class BookmarkHTMLReaderTestWithData : public testing::Test { | 142 class BookmarkHTMLReaderTestWithData : public testing::Test { |
| 143 public: | 143 public: |
| 144 virtual void SetUp() OVERRIDE; | 144 virtual void SetUp() override; |
| 145 | 145 |
| 146 protected: | 146 protected: |
| 147 void ExpectFirstFirefox2Bookmark(const ImportedBookmarkEntry& entry); | 147 void ExpectFirstFirefox2Bookmark(const ImportedBookmarkEntry& entry); |
| 148 void ExpectSecondFirefox2Bookmark(const ImportedBookmarkEntry& entry); | 148 void ExpectSecondFirefox2Bookmark(const ImportedBookmarkEntry& entry); |
| 149 void ExpectThirdFirefox2Bookmark(const ImportedBookmarkEntry& entry); | 149 void ExpectThirdFirefox2Bookmark(const ImportedBookmarkEntry& entry); |
| 150 void ExpectFirstEpiphanyBookmark(const ImportedBookmarkEntry& entry); | 150 void ExpectFirstEpiphanyBookmark(const ImportedBookmarkEntry& entry); |
| 151 void ExpectSecondEpiphanyBookmark(const ImportedBookmarkEntry& entry); | 151 void ExpectSecondEpiphanyBookmark(const ImportedBookmarkEntry& entry); |
| 152 void ExpectFirstFirefox23Bookmark(const ImportedBookmarkEntry& entry); | 152 void ExpectFirstFirefox23Bookmark(const ImportedBookmarkEntry& entry); |
| 153 void ExpectSecondFirefox23Bookmark(const ImportedBookmarkEntry& entry); | 153 void ExpectSecondFirefox23Bookmark(const ImportedBookmarkEntry& entry); |
| 154 void ExpectThirdFirefox23Bookmark(const ImportedBookmarkEntry& entry); | 154 void ExpectThirdFirefox23Bookmark(const ImportedBookmarkEntry& entry); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 ImportBookmarksFile(base::Callback<bool(void)>(), | 327 ImportBookmarksFile(base::Callback<bool(void)>(), |
| 328 base::Bind(&IsURLValid), | 328 base::Bind(&IsURLValid), |
| 329 path, &bookmarks, NULL); | 329 path, &bookmarks, NULL); |
| 330 | 330 |
| 331 ASSERT_EQ(2U, bookmarks.size()); | 331 ASSERT_EQ(2U, bookmarks.size()); |
| 332 ExpectFirstFirefox2Bookmark(bookmarks[0]); | 332 ExpectFirstFirefox2Bookmark(bookmarks[0]); |
| 333 ExpectThirdFirefox2Bookmark(bookmarks[1]); | 333 ExpectThirdFirefox2Bookmark(bookmarks[1]); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace bookmark_html_reader | 336 } // namespace bookmark_html_reader |
| OLD | NEW |