Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: chrome/browser/bookmarks/bookmark_html_writer_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 BookmarkEntryToString(entry)); 121 BookmarkEntryToString(entry));
122 } 122 }
123 123
124 base::ScopedTempDir temp_dir_; 124 base::ScopedTempDir temp_dir_;
125 base::FilePath path_; 125 base::FilePath path_;
126 }; 126 };
127 127
128 // Class that will notify message loop when file is written. 128 // Class that will notify message loop when file is written.
129 class BookmarksObserver : public BookmarksExportObserver { 129 class BookmarksObserver : public BookmarksExportObserver {
130 public: 130 public:
131 explicit BookmarksObserver(MessageLoop* loop) : loop_(loop) { 131 explicit BookmarksObserver(base::MessageLoop* loop) : loop_(loop) {
132 DCHECK(loop); 132 DCHECK(loop);
133 } 133 }
134 134
135 virtual void OnExportFinished() OVERRIDE { 135 virtual void OnExportFinished() OVERRIDE {
136 loop_->Quit(); 136 loop_->Quit();
137 } 137 }
138 138
139 private: 139 private:
140 MessageLoop* loop_; 140 base::MessageLoop* loop_;
141 DISALLOW_COPY_AND_ASSIGN(BookmarksObserver); 141 DISALLOW_COPY_AND_ASSIGN(BookmarksObserver);
142 }; 142 };
143 143
144 // Tests bookmark_html_writer by populating a BookmarkModel, writing it out by 144 // Tests bookmark_html_writer by populating a BookmarkModel, writing it out by
145 // way of bookmark_html_writer, then using the importer to read it back in. 145 // way of bookmark_html_writer, then using the importer to read it back in.
146 TEST_F(BookmarkHTMLWriterTest, Test) { 146 TEST_F(BookmarkHTMLWriterTest, Test) {
147 MessageLoop message_loop; 147 base::MessageLoop message_loop;
148 content::TestBrowserThread fake_ui_thread(BrowserThread::UI, &message_loop); 148 content::TestBrowserThread fake_ui_thread(BrowserThread::UI, &message_loop);
149 content::TestBrowserThread fake_file_thread(BrowserThread::FILE, 149 content::TestBrowserThread fake_file_thread(BrowserThread::FILE,
150 &message_loop); 150 &message_loop);
151 151
152 TestingProfile profile; 152 TestingProfile profile;
153 profile.CreateHistoryService(true, false); 153 profile.CreateHistoryService(true, false);
154 profile.BlockUntilHistoryProcessesPendingRequests(); 154 profile.BlockUntilHistoryProcessesPendingRequests();
155 profile.CreateFaviconService(); 155 profile.CreateFaviconService();
156 profile.CreateBookmarkModel(true); 156 profile.CreateBookmarkModel(true);
157 157
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url2, url2_title, t2, 276 AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url2, url2_title, t2,
277 string16(), string16(), string16()); 277 string16(), string16(), string16());
278 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, 278 AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1,
279 f3_title, f4_title, string16()); 279 f3_title, f4_title, string16());
280 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, 280 AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1,
281 string16(), string16(), string16()); 281 string16(), string16(), string16());
282 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, 282 AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url,
283 unnamed_bookmark_title, t2, 283 unnamed_bookmark_title, t2,
284 string16(), string16(), string16()); 284 string16(), string16(), string16());
285 } 285 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_html_writer.cc ('k') | chrome/browser/bookmarks/bookmark_index_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698