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 "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/files/scoped_temp_dir.h" |
8 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
9 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
11 #include "base/scoped_temp_dir.h" | |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/bookmarks/bookmark_html_writer.h" | 16 #include "chrome/browser/bookmarks/bookmark_html_writer.h" |
17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
19 #include "chrome/browser/favicon/favicon_service_factory.h" | 19 #include "chrome/browser/favicon/favicon_service_factory.h" |
20 #include "chrome/browser/history/history_service_factory.h" | 20 #include "chrome/browser/history/history_service_factory.h" |
21 #include "chrome/browser/importer/firefox2_importer.h" | 21 #include "chrome/browser/importer/firefox2_importer.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const string16& title, | 109 const string16& title, |
110 base::Time creation_time, | 110 base::Time creation_time, |
111 const string16& f1, | 111 const string16& f1, |
112 const string16& f2, | 112 const string16& f2, |
113 const string16& f3) { | 113 const string16& f3) { |
114 EXPECT_EQ(BookmarkValuesToString(on_toolbar, url, title, creation_time, | 114 EXPECT_EQ(BookmarkValuesToString(on_toolbar, url, title, creation_time, |
115 f1, f2, f3), | 115 f1, f2, f3), |
116 BookmarkEntryToString(entry)); | 116 BookmarkEntryToString(entry)); |
117 } | 117 } |
118 | 118 |
119 ScopedTempDir temp_dir_; | 119 base::ScopedTempDir temp_dir_; |
120 FilePath path_; | 120 FilePath path_; |
121 }; | 121 }; |
122 | 122 |
123 // Class that will notify message loop when file is written. | 123 // Class that will notify message loop when file is written. |
124 class BookmarksObserver : public BookmarksExportObserver { | 124 class BookmarksObserver : public BookmarksExportObserver { |
125 public: | 125 public: |
126 explicit BookmarksObserver(MessageLoop* loop) : loop_(loop) { | 126 explicit BookmarksObserver(MessageLoop* loop) : loop_(loop) { |
127 DCHECK(loop); | 127 DCHECK(loop); |
128 } | 128 } |
129 | 129 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 bookmark_folder_name, string16(), string16()); | 262 bookmark_folder_name, string16(), string16()); |
263 AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url1, url1_title, t1, | 263 AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url1, url1_title, t1, |
264 string16(), string16(), string16()); | 264 string16(), string16(), string16()); |
265 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url2, url2_title, t2, | 265 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url2, url2_title, t2, |
266 string16(), string16(), string16()); | 266 string16(), string16(), string16()); |
267 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, | 267 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, |
268 f3_title, f4_title, string16()); | 268 f3_title, f4_title, string16()); |
269 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, | 269 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, |
270 string16(), string16(), string16()); | 270 string16(), string16(), string16()); |
271 } | 271 } |
OLD | NEW |