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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // way of bookmark_html_writer, then using the importer to read it back in. | 149 // way of bookmark_html_writer, then using the importer to read it back in. |
150 TEST_F(BookmarkHTMLWriterTest, Test) { | 150 TEST_F(BookmarkHTMLWriterTest, Test) { |
151 content::TestBrowserThreadBundle thread_bundle; | 151 content::TestBrowserThreadBundle thread_bundle; |
152 | 152 |
153 TestingProfile profile; | 153 TestingProfile profile; |
154 ASSERT_TRUE(profile.CreateHistoryService(true, false)); | 154 ASSERT_TRUE(profile.CreateHistoryService(true, false)); |
155 profile.BlockUntilHistoryProcessesPendingRequests(); | 155 profile.BlockUntilHistoryProcessesPendingRequests(); |
156 profile.CreateFaviconService(); | 156 profile.CreateFaviconService(); |
157 profile.CreateBookmarkModel(true); | 157 profile.CreateBookmarkModel(true); |
158 | 158 |
159 BookmarkModel* model = BookmarkModelFactory::GetForProfile(&profile); | 159 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(&profile); |
160 bookmarks::test::WaitForBookmarkModelToLoad(model); | 160 bookmarks::test::WaitForBookmarkModelToLoad(model); |
161 | 161 |
162 // Create test PNG representing favicon for url1. | 162 // Create test PNG representing favicon for url1. |
163 SkBitmap bitmap; | 163 SkBitmap bitmap; |
164 MakeTestSkBitmap(kIconWidth, kIconHeight, &bitmap); | 164 MakeTestSkBitmap(kIconWidth, kIconHeight, &bitmap); |
165 std::vector<unsigned char> icon_data; | 165 std::vector<unsigned char> icon_data; |
166 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &icon_data); | 166 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &icon_data); |
167 | 167 |
168 // Populate the BookmarkModel. This creates the following bookmark structure: | 168 // Populate the BookmarkModel. This creates the following bookmark structure: |
169 // Bookmarks bar | 169 // Bookmarks bar |
(...skipping 127 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 |