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

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

Issue 16533: Convert download manager to FilePath. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« no previous file with comments | « chrome/browser/history/download_types.h ('k') | chrome/browser/views/download_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 history_service_ = NULL; 186 history_service_ = NULL;
187 187
188 // Wait for the backend class to terminate before deleting the files and 188 // Wait for the backend class to terminate before deleting the files and
189 // moving to the next test. Note: if this never terminates, somebody is 189 // moving to the next test. Note: if this never terminates, somebody is
190 // probably leaking a reference to the history backend, so it never calls 190 // probably leaking a reference to the history backend, so it never calls
191 // our destroy task. 191 // our destroy task.
192 MessageLoop::current()->Run(); 192 MessageLoop::current()->Run();
193 } 193 }
194 194
195 int64 AddDownload(int32 state, const Time& time) { 195 int64 AddDownload(int32 state, const Time& time) {
196 DownloadCreateInfo download(L"foo-path", L"foo-url", time, 196 DownloadCreateInfo download(FilePath(FILE_PATH_LITERAL("foo-path")),
197 0, 512, state, 0); 197 L"foo-url", time, 0, 512, state, 0);
198 return db_->CreateDownload(download); 198 return db_->CreateDownload(download);
199 } 199 }
200 200
201 // Fills the query_url_row_ and query_url_visits_ structures with the 201 // Fills the query_url_row_ and query_url_visits_ structures with the
202 // information about the given URL and returns true. If the URL was not 202 // information about the given URL and returns true. If the URL was not
203 // found, this will return false and those structures will not be changed. 203 // found, this will return false and those structures will not be changed.
204 bool QueryURL(HistoryService* history, const GURL& url) { 204 bool QueryURL(HistoryService* history, const GURL& url) {
205 history->QueryURL(url, true, &consumer_, 205 history->QueryURL(url, true, &consumer_,
206 NewCallback(this, &HistoryTest::SaveURLAndQuit)); 206 NewCallback(this, &HistoryTest::SaveURLAndQuit));
207 MessageLoop::current()->Run(); // Will be exited in SaveURLAndQuit. 207 MessageLoop::current()->Run(); // Will be exited in SaveURLAndQuit.
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 history->ScheduleDBTask(task.get(), &request_consumer); 827 history->ScheduleDBTask(task.get(), &request_consumer);
828 request_consumer.CancelAllRequests(); 828 request_consumer.CancelAllRequests();
829 CleanupHistoryService(); 829 CleanupHistoryService();
830 // WARNING: history has now been deleted. 830 // WARNING: history has now been deleted.
831 history = NULL; 831 history = NULL;
832 ASSERT_FALSE(task->done_invoked); 832 ASSERT_FALSE(task->done_invoked);
833 } 833 }
834 834
835 } // namespace history 835 } // namespace history
836 836
OLDNEW
« no previous file with comments | « chrome/browser/history/download_types.h ('k') | chrome/browser/views/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698