| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/bookmarks/bookmark_html_writer.h" | 5 #include "chrome/browser/bookmarks/bookmark_html_writer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 class BookmarkHTMLWriterTest : public testing::Test { | 56 class BookmarkHTMLWriterTest : public testing::Test { |
| 57 protected: | 57 protected: |
| 58 void SetUp() override { | 58 void SetUp() override { |
| 59 testing::Test::SetUp(); | 59 testing::Test::SetUp(); |
| 60 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 60 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 61 path_ = temp_dir_.path().AppendASCII("bookmarks.html"); | 61 path_ = temp_dir_.GetPath().AppendASCII("bookmarks.html"); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Converts an ImportedBookmarkEntry to a string suitable for assertion | 64 // Converts an ImportedBookmarkEntry to a string suitable for assertion |
| 65 // testing. | 65 // testing. |
| 66 base::string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { | 66 base::string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { |
| 67 base::string16 result; | 67 base::string16 result; |
| 68 result.append(base::ASCIIToUTF16("on_toolbar=")); | 68 result.append(base::ASCIIToUTF16("on_toolbar=")); |
| 69 if (entry.in_toolbar) | 69 if (entry.in_toolbar) |
| 70 result.append(base::ASCIIToUTF16("true")); | 70 result.append(base::ASCIIToUTF16("true")); |
| 71 else | 71 else |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, | 297 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, |
| 298 f3_title, f4_title, base::string16()); | 298 f3_title, f4_title, base::string16()); |
| 299 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, | 299 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, |
| 300 base::string16(), base::string16(), | 300 base::string16(), base::string16(), |
| 301 base::string16()); | 301 base::string16()); |
| 302 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, | 302 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, |
| 303 unnamed_bookmark_title, t2, | 303 unnamed_bookmark_title, t2, |
| 304 base::string16(), base::string16(), | 304 base::string16(), base::string16(), |
| 305 base::string16()); | 305 base::string16()); |
| 306 } | 306 } |
| OLD | NEW |