| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_html_writer.h" | 10 #include "chrome/browser/bookmarks/bookmark_html_writer.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Write to a temp file. | 102 // Write to a temp file. |
| 103 bookmark_html_writer::WriteBookmarks(NULL, &model, path_); | 103 bookmark_html_writer::WriteBookmarks(NULL, &model, path_); |
| 104 | 104 |
| 105 // Read the bookmarks back in. | 105 // Read the bookmarks back in. |
| 106 std::vector<ProfileWriter::BookmarkEntry> parsed_bookmarks; | 106 std::vector<ProfileWriter::BookmarkEntry> parsed_bookmarks; |
| 107 Firefox2Importer::ImportBookmarksFile(path_, std::set<GURL>(), false, | 107 Firefox2Importer::ImportBookmarksFile(path_, std::set<GURL>(), false, |
| 108 L"x", NULL, &parsed_bookmarks, NULL, | 108 L"x", NULL, &parsed_bookmarks, NULL, |
| 109 NULL); | 109 NULL); |
| 110 | 110 |
| 111 // Verify we got back what we wrote. | 111 // Verify we got back what we wrote. |
| 112 ASSERT_EQ(6U, parsed_bookmarks.size()); | 112 ASSERT_EQ(6, parsed_bookmarks.size()); |
| 113 AssertBookmarkEntryEquals(parsed_bookmarks[0], false, url1, url1_title, t1, | 113 AssertBookmarkEntryEquals(parsed_bookmarks[0], false, url1, url1_title, t1, |
| 114 L"Bookmark Bar", f1_title, std::wstring()); | 114 L"Bookmark Bar", f1_title, std::wstring()); |
| 115 AssertBookmarkEntryEquals(parsed_bookmarks[1], false, url2, url2_title, t2, | 115 AssertBookmarkEntryEquals(parsed_bookmarks[1], false, url2, url2_title, t2, |
| 116 L"Bookmark Bar", f1_title, f2_title); | 116 L"Bookmark Bar", f1_title, f2_title); |
| 117 AssertBookmarkEntryEquals(parsed_bookmarks[2], false, url3, url3_title, t3, | 117 AssertBookmarkEntryEquals(parsed_bookmarks[2], false, url3, url3_title, t3, |
| 118 L"Bookmark Bar", std::wstring(), std::wstring()); | 118 L"Bookmark Bar", std::wstring(), std::wstring()); |
| 119 AssertBookmarkEntryEquals(parsed_bookmarks[3], false, url1, url1_title, t1, | 119 AssertBookmarkEntryEquals(parsed_bookmarks[3], false, url1, url1_title, t1, |
| 120 std::wstring(), std::wstring(), std::wstring()); | 120 std::wstring(), std::wstring(), std::wstring()); |
| 121 AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url2, url2_title, t2, | 121 AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url2, url2_title, t2, |
| 122 std::wstring(), std::wstring(), std::wstring()); | 122 std::wstring(), std::wstring(), std::wstring()); |
| 123 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url1, url1_title, t1, | 123 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url1, url1_title, t1, |
| 124 f3_title, f4_title, std::wstring()); | 124 f3_title, f4_title, std::wstring()); |
| 125 } | 125 } |
| OLD | NEW |