OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
| 8 #include <string.h> |
| 9 |
8 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
11 #include "base/location.h" | 13 #include "base/location.h" |
12 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
13 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
14 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
15 #include "build/build_config.h" | 17 #include "build/build_config.h" |
16 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 18 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
17 #include "chrome/browser/download/download_item_model.h" | 19 #include "chrome/browser/download/download_item_model.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 EXPECT_CALL(*download_item, GetDangerType()) | 667 EXPECT_CALL(*download_item, GetDangerType()) |
666 .WillRepeatedly(Return(kParameters.initial_danger_type)); | 668 .WillRepeatedly(Return(kParameters.initial_danger_type)); |
667 | 669 |
668 if (kParameters.initial_danger_level != DownloadFileType::NOT_DANGEROUS) { | 670 if (kParameters.initial_danger_level != DownloadFileType::NOT_DANGEROUS) { |
669 DownloadItemModel(download_item.get()) | 671 DownloadItemModel(download_item.get()) |
670 .SetDangerLevel(kParameters.initial_danger_level); | 672 .SetDangerLevel(kParameters.initial_danger_level); |
671 } | 673 } |
672 | 674 |
673 if (kParameters.expected_danger_type != | 675 if (kParameters.expected_danger_type != |
674 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) { | 676 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) { |
675 EXPECT_CALL(*download_item, | 677 EXPECT_CALL(*download_item, OnContentCheckCompleted( |
676 OnContentCheckCompleted(kParameters.expected_danger_type)); | 678 kParameters.expected_danger_type, false)); |
677 } else { | 679 } else { |
678 EXPECT_CALL(*download_item, OnContentCheckCompleted(_)).Times(0); | 680 EXPECT_CALL(*download_item, OnContentCheckCompleted(_, _)).Times(0); |
679 } | 681 } |
680 | 682 |
681 base::RunLoop run_loop; | 683 base::RunLoop run_loop; |
682 ASSERT_FALSE(delegate()->ShouldCompleteDownload(download_item.get(), | 684 ASSERT_FALSE(delegate()->ShouldCompleteDownload(download_item.get(), |
683 run_loop.QuitClosure())); | 685 run_loop.QuitClosure())); |
684 run_loop.Run(); | 686 run_loop.Run(); |
685 } | 687 } |
686 | 688 |
687 #endif // FULL_SAFE_BROWSING | 689 #endif // FULL_SAFE_BROWSING |
OLD | NEW |