OLD | NEW |
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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 slow_download_job_pending_requests_ = | 125 slow_download_job_pending_requests_ = |
126 URLRequestSlowDownloadJob::NumberOutstandingRequests(); | 126 URLRequestSlowDownloadJob::NumberOutstandingRequests(); |
127 BrowserThread::PostTask( | 127 BrowserThread::PostTask( |
128 BrowserThread::FILE, FROM_HERE, | 128 BrowserThread::FILE, FROM_HERE, |
129 base::Bind(&CancelTestDataCollector::FileInfoCollector, this)); | 129 base::Bind(&CancelTestDataCollector::FileInfoCollector, this)); |
130 } | 130 } |
131 | 131 |
132 void FileInfoCollector() { | 132 void FileInfoCollector() { |
133 dfm_pending_downloads_ = download_file_manager_->NumberOfActiveDownloads(); | 133 dfm_pending_downloads_ = download_file_manager_->NumberOfActiveDownloads(); |
134 BrowserThread::PostTask( | 134 BrowserThread::PostTask( |
135 BrowserThread::UI, FROM_HERE, new MessageLoop::QuitTask()); | 135 BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); |
136 } | 136 } |
137 | 137 |
138 ResourceDispatcherHost* resource_dispatcher_host_; | 138 ResourceDispatcherHost* resource_dispatcher_host_; |
139 DownloadFileManager* download_file_manager_; | 139 DownloadFileManager* download_file_manager_; |
140 int slow_download_job_pending_requests_; | 140 int slow_download_job_pending_requests_; |
141 int dfm_pending_downloads_; | 141 int dfm_pending_downloads_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(CancelTestDataCollector); | 143 DISALLOW_COPY_AND_ASSIGN(CancelTestDataCollector); |
144 }; | 144 }; |
145 | 145 |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 search_results.clear(); | 1663 search_results.clear(); |
1664 | 1664 |
1665 manager->SearchDownloads(UTF8ToUTF16("another_file"), &search_results); | 1665 manager->SearchDownloads(UTF8ToUTF16("another_file"), &search_results); |
1666 ASSERT_EQ(2u, search_results.size()); | 1666 ASSERT_EQ(2u, search_results.size()); |
1667 std::sort(search_results.begin(), search_results.end(), | 1667 std::sort(search_results.begin(), search_results.end(), |
1668 DownloadItemSorter); | 1668 DownloadItemSorter); |
1669 EXPECT_EQ(2, search_results[0]->GetDbHandle()); | 1669 EXPECT_EQ(2, search_results[0]->GetDbHandle()); |
1670 EXPECT_EQ(3, search_results[1]->GetDbHandle()); | 1670 EXPECT_EQ(3, search_results[1]->GetDbHandle()); |
1671 search_results.clear(); | 1671 search_results.clear(); |
1672 } | 1672 } |
OLD | NEW |