| 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 "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 uint32_t* src_data = bmp->getAddr32(0, 0); | 41 uint32_t* src_data = bmp->getAddr32(0, 0); |
| 42 for (int i = 0; i < w * h; i++) { | 42 for (int i = 0; i < w * h; i++) { |
| 43 src_data[i] = SkPreMultiplyARGB(i % 255, i % 250, i % 245, i % 240); | 43 src_data[i] = SkPreMultiplyARGB(i % 255, i % 250, i % 245, i % 240); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 class BookmarkHTMLWriterTest : public testing::Test { | 49 class BookmarkHTMLWriterTest : public testing::Test { |
| 50 protected: | 50 protected: |
| 51 virtual void SetUp() { | 51 void SetUp() override { |
| 52 testing::Test::SetUp(); | 52 testing::Test::SetUp(); |
| 53 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 53 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 54 path_ = temp_dir_.path().AppendASCII("bookmarks.html"); | 54 path_ = temp_dir_.path().AppendASCII("bookmarks.html"); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Converts an ImportedBookmarkEntry to a string suitable for assertion | 57 // Converts an ImportedBookmarkEntry to a string suitable for assertion |
| 58 // testing. | 58 // testing. |
| 59 base::string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { | 59 base::string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { |
| 60 base::string16 result; | 60 base::string16 result; |
| 61 result.append(base::ASCIIToUTF16("on_toolbar=")); | 61 result.append(base::ASCIIToUTF16("on_toolbar=")); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, | 283 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, |
| 284 f3_title, f4_title, base::string16()); | 284 f3_title, f4_title, base::string16()); |
| 285 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, | 285 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, |
| 286 base::string16(), base::string16(), | 286 base::string16(), base::string16(), |
| 287 base::string16()); | 287 base::string16()); |
| 288 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, | 288 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, |
| 289 unnamed_bookmark_title, t2, | 289 unnamed_bookmark_title, t2, |
| 290 base::string16(), base::string16(), | 290 base::string16(), base::string16(), |
| 291 base::string16()); | 291 base::string16()); |
| 292 } | 292 } |
| OLD | NEW |