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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 void(const base::FilePath&, TargetDisposition, | 86 void(const base::FilePath&, TargetDisposition, |
87 DownloadDangerType, const base::FilePath&)); | 87 DownloadDangerType, const base::FilePath&)); |
88 MOCK_METHOD1(AddObserver, void(DownloadItem::Observer*)); | 88 MOCK_METHOD1(AddObserver, void(DownloadItem::Observer*)); |
89 MOCK_METHOD1(RemoveObserver, void(DownloadItem::Observer*)); | 89 MOCK_METHOD1(RemoveObserver, void(DownloadItem::Observer*)); |
90 MOCK_METHOD0(UpdateObservers, void()); | 90 MOCK_METHOD0(UpdateObservers, void()); |
91 MOCK_METHOD0(CanShowInFolder, bool()); | 91 MOCK_METHOD0(CanShowInFolder, bool()); |
92 MOCK_METHOD0(CanOpenDownload, bool()); | 92 MOCK_METHOD0(CanOpenDownload, bool()); |
93 MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool()); | 93 MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool()); |
94 MOCK_METHOD0(OpenDownload, void()); | 94 MOCK_METHOD0(OpenDownload, void()); |
95 MOCK_METHOD0(ShowDownloadInShell, void()); | 95 MOCK_METHOD0(ShowDownloadInShell, void()); |
96 MOCK_METHOD0(DangerousDownloadValidated, void()); | 96 MOCK_METHOD0(ValidateDangerousDownload, void()); |
97 MOCK_METHOD3(UpdateProgress, void(int64, int64, const std::string&)); | 97 MOCK_METHOD3(UpdateProgress, void(int64, int64, const std::string&)); |
98 MOCK_METHOD1(Cancel, void(bool)); | 98 MOCK_METHOD1(Cancel, void(bool)); |
99 MOCK_METHOD0(MarkAsComplete, void()); | 99 MOCK_METHOD0(MarkAsComplete, void()); |
100 MOCK_METHOD1(OnAllDataSaved, void(const std::string&)); | 100 MOCK_METHOD1(OnAllDataSaved, void(const std::string&)); |
101 MOCK_METHOD0(OnDownloadedFileRemoved, void()); | 101 MOCK_METHOD0(OnDownloadedFileRemoved, void()); |
102 virtual void Start( | 102 virtual void Start( |
103 scoped_ptr<DownloadFile> download_file, | 103 scoped_ptr<DownloadFile> download_file, |
104 scoped_ptr<DownloadRequestHandleInterface> req_handle) OVERRIDE { | 104 scoped_ptr<DownloadRequestHandleInterface> req_handle) OVERRIDE { |
105 MockStart(download_file.get(), req_handle.get()); | 105 MockStart(download_file.get(), req_handle.get()); |
106 } | 106 } |
107 | 107 |
108 MOCK_METHOD2(MockStart, void(DownloadFile*, DownloadRequestHandleInterface*)); | 108 MOCK_METHOD2(MockStart, void(DownloadFile*, DownloadRequestHandleInterface*)); |
109 | 109 |
110 MOCK_METHOD1(Delete, void(DeleteReason)); | 110 MOCK_METHOD1(Delete, void(DeleteReason)); |
benjhayden
2013/05/22 19:43:26
Update.
| |
111 MOCK_METHOD0(Remove, void()); | 111 MOCK_METHOD0(Remove, void()); |
112 MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta*)); | 112 MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta*)); |
113 MOCK_CONST_METHOD0(CurrentSpeed, int64()); | 113 MOCK_CONST_METHOD0(CurrentSpeed, int64()); |
114 MOCK_CONST_METHOD0(PercentComplete, int()); | 114 MOCK_CONST_METHOD0(PercentComplete, int()); |
115 MOCK_CONST_METHOD0(AllDataSaved, bool()); | 115 MOCK_CONST_METHOD0(AllDataSaved, bool()); |
116 MOCK_CONST_METHOD1(MatchesQuery, bool(const string16& query)); | 116 MOCK_CONST_METHOD1(MatchesQuery, bool(const string16& query)); |
117 MOCK_CONST_METHOD0(IsPartialDownload, bool()); | 117 MOCK_CONST_METHOD0(IsPartialDownload, bool()); |
118 MOCK_CONST_METHOD0(IsInProgress, bool()); | 118 MOCK_CONST_METHOD0(IsInProgress, bool()); |
119 MOCK_CONST_METHOD0(IsCancelled, bool()); | 119 MOCK_CONST_METHOD0(IsCancelled, bool()); |
120 MOCK_CONST_METHOD0(IsInterrupted, bool()); | 120 MOCK_CONST_METHOD0(IsInterrupted, bool()); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 .WillOnce(Return()); | 681 .WillOnce(Return()); |
682 EXPECT_CALL(GetMockDownloadItem(3), Remove()) | 682 EXPECT_CALL(GetMockDownloadItem(3), Remove()) |
683 .Times(0); | 683 .Times(0); |
684 | 684 |
685 download_manager_->RemoveAllDownloads(); | 685 download_manager_->RemoveAllDownloads(); |
686 // Because we're mocking the download item, the Remove call doesn't | 686 // Because we're mocking the download item, the Remove call doesn't |
687 // result in them being removed from the DownloadManager list. | 687 // result in them being removed from the DownloadManager list. |
688 } | 688 } |
689 | 689 |
690 } // namespace content | 690 } // namespace content |
OLD | NEW |