| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/safe_browsing/incident_reporting/last_download_finder.h
" | 5 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 47LL, // total | 288 47LL, // total |
| 289 history::DownloadState::COMPLETE, // download_state | 289 history::DownloadState::COMPLETE, // download_state |
| 290 history::DownloadDangerType::NOT_DANGEROUS, // danger_type | 290 history::DownloadDangerType::NOT_DANGEROUS, // danger_type |
| 291 history::ToHistoryDownloadInterruptReason( | 291 history::ToHistoryDownloadInterruptReason( |
| 292 content::DOWNLOAD_INTERRUPT_REASON_NONE), // interrupt_reason, | 292 content::DOWNLOAD_INTERRUPT_REASON_NONE), // interrupt_reason, |
| 293 std::string(), // hash | 293 std::string(), // hash |
| 294 download_id_++, // id | 294 download_id_++, // id |
| 295 base::GenerateGUID(), // GUID | 295 base::GenerateGUID(), // GUID |
| 296 false, // download_opened | 296 false, // download_opened |
| 297 std::string(), // ext_id | 297 std::string(), // ext_id |
| 298 std::string()); // ext_name | 298 std::string(), // ext_name |
| 299 std::vector<history::DownloadJobInfo>()); // download_job_info |
| 299 } | 300 } |
| 300 | 301 |
| 301 content::TestBrowserThreadBundle browser_thread_bundle_; | 302 content::TestBrowserThreadBundle browser_thread_bundle_; |
| 302 std::unique_ptr<TestingProfileManager> profile_manager_; | 303 std::unique_ptr<TestingProfileManager> profile_manager_; |
| 303 | 304 |
| 304 private: | 305 private: |
| 305 // A HistoryService::DownloadCreateCallback that asserts that the download was | 306 // A HistoryService::DownloadCreateCallback that asserts that the download was |
| 306 // created and runs |closure|. | 307 // created and runs |closure|. |
| 307 void ContinueOnDownloadCreated(const base::Closure& closure, bool created) { | 308 void ContinueOnDownloadCreated(const base::Closure& closure, bool created) { |
| 308 ASSERT_TRUE(created); | 309 ASSERT_TRUE(created); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 base::Bind(&LastDownloadFinderTest::OnLastDownload, | 465 base::Bind(&LastDownloadFinderTest::OnLastDownload, |
| 465 base::Unretained(this), &last_binary_download, | 466 base::Unretained(this), &last_binary_download, |
| 466 &last_non_binary_download, run_loop.QuitClosure()))); | 467 &last_non_binary_download, run_loop.QuitClosure()))); |
| 467 | 468 |
| 468 run_loop.Run(); | 469 run_loop.Run(); |
| 469 | 470 |
| 470 ASSERT_TRUE(last_binary_download); | 471 ASSERT_TRUE(last_binary_download); |
| 471 } | 472 } |
| 472 | 473 |
| 473 } // namespace safe_browsing | 474 } // namespace safe_browsing |
| OLD | NEW |