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

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

Issue 10963018: Rework arguments of HistoryService::AddPage() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile Created 8 years, 3 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 "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/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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 GURL url3("http://url3"); 188 GURL url3("http://url3");
189 GURL url4("javascript:alert(\"Hello!\");"); 189 GURL url4("javascript:alert(\"Hello!\");");
190 base::Time t1(base::Time::Now()); 190 base::Time t1(base::Time::Now());
191 base::Time t2(t1 + base::TimeDelta::FromHours(1)); 191 base::Time t2(t1 + base::TimeDelta::FromHours(1));
192 base::Time t3(t1 + base::TimeDelta::FromHours(1)); 192 base::Time t3(t1 + base::TimeDelta::FromHours(1));
193 base::Time t4(t1 + base::TimeDelta::FromHours(1)); 193 base::Time t4(t1 + base::TimeDelta::FromHours(1));
194 const BookmarkNode* f1 = model->AddFolder( 194 const BookmarkNode* f1 = model->AddFolder(
195 model->bookmark_bar_node(), 0, f1_title); 195 model->bookmark_bar_node(), 0, f1_title);
196 model->AddURLWithCreationTime(f1, 0, url1_title, url1, t1); 196 model->AddURLWithCreationTime(f1, 0, url1_title, url1, t1);
197 HistoryServiceFactory::GetForProfile(&profile, Profile::EXPLICIT_ACCESS)-> 197 HistoryServiceFactory::GetForProfile(&profile, Profile::EXPLICIT_ACCESS)->
198 AddPage(url1, history::SOURCE_BROWSED); 198 AddPage(url1, base::Time::Now(), history::SOURCE_BROWSED);
199 FaviconServiceFactory::GetForProfile( 199 FaviconServiceFactory::GetForProfile(
200 &profile, Profile::EXPLICIT_ACCESS)->SetFavicons( 200 &profile, Profile::EXPLICIT_ACCESS)->SetFavicons(
201 url1, url1_favicon, history::FAVICON, gfx::Image(bitmap)); 201 url1, url1_favicon, history::FAVICON, gfx::Image(bitmap));
202 message_loop.RunAllPending(); 202 message_loop.RunAllPending();
203 const BookmarkNode* f2 = model->AddFolder(f1, 1, f2_title); 203 const BookmarkNode* f2 = model->AddFolder(f1, 1, f2_title);
204 model->AddURLWithCreationTime(f2, 0, url2_title, url2, t2); 204 model->AddURLWithCreationTime(f2, 0, url2_title, url2, t2);
205 model->AddURLWithCreationTime(model->bookmark_bar_node(), 205 model->AddURLWithCreationTime(model->bookmark_bar_node(),
206 1, url3_title, url3, t3); 206 1, url3_title, url3, t3);
207 207
208 model->AddURLWithCreationTime(model->other_node(), 0, url1_title, url1, t1); 208 model->AddURLWithCreationTime(model->other_node(), 0, url1_title, url1, t1);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698