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

Side by Side Diff: chrome/browser/history/history_unittest.cc

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup, and added fields to DownloadPersistentStoreInfo. Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // History unit tests come in two flavors: 5 // History unit tests come in two flavors:
6 // 6 //
7 // 1. The more complicated style is that the unit test creates a full history 7 // 1. The more complicated style is that the unit test creates a full history
8 // service. This spawns a background thread for the history backend, and 8 // service. This spawns a background thread for the history backend, and
9 // all communication is asynchronous. This is useful for testing more 9 // all communication is asynchronous. This is useful for testing more
10 // complicated things or end-to-end behavior. 10 // complicated things or end-to-end behavior.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DownloadPersistentStoreInfo download( 191 DownloadPersistentStoreInfo download(
192 FilePath(FILE_PATH_LITERAL("foo-path")), 192 FilePath(FILE_PATH_LITERAL("foo-path")),
193 GURL("foo-url"), 193 GURL("foo-url"),
194 GURL(""), 194 GURL(""),
195 time, 195 time,
196 time, 196 time,
197 0, 197 0,
198 512, 198 512,
199 state, 199 state,
200 0, 200 0,
201 0); 201 false,
202 -1,
203 "",
204 "",
205 "",
206 DOWNLOAD_INTERRUPT_REASON_NONE);
202 return db_->CreateDownload(download); 207 return db_->CreateDownload(download);
203 } 208 }
204 209
205 // Fills the query_url_row_ and query_url_visits_ structures with the 210 // Fills the query_url_row_ and query_url_visits_ structures with the
206 // information about the given URL and returns true. If the URL was not 211 // information about the given URL and returns true. If the URL was not
207 // found, this will return false and those structures will not be changed. 212 // found, this will return false and those structures will not be changed.
208 bool QueryURL(HistoryService* history, const GURL& url) { 213 bool QueryURL(HistoryService* history, const GURL& url) {
209 history->QueryURL(url, true, &consumer_, 214 history->QueryURL(url, true, &consumer_,
210 base::Bind(&HistoryTest::SaveURLAndQuit, 215 base::Bind(&HistoryTest::SaveURLAndQuit,
211 base::Unretained(this))); 216 base::Unretained(this)));
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 history_service_ = history; 963 history_service_ = history;
959 history->ScheduleDBTask(task.get(), &request_consumer); 964 history->ScheduleDBTask(task.get(), &request_consumer);
960 request_consumer.CancelAllRequests(); 965 request_consumer.CancelAllRequests();
961 CleanupHistoryService(); 966 CleanupHistoryService();
962 // WARNING: history has now been deleted. 967 // WARNING: history has now been deleted.
963 history = NULL; 968 history = NULL;
964 ASSERT_FALSE(task->done_invoked); 969 ASSERT_FALSE(task->done_invoked);
965 } 970 }
966 971
967 } // namespace history 972 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698