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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 MOCK_METHOD1(SetIsTemporary, void(bool)); | 151 MOCK_METHOD1(SetIsTemporary, void(bool)); |
152 MOCK_METHOD1(SetOpened, void(bool)); | 152 MOCK_METHOD1(SetOpened, void(bool)); |
153 MOCK_CONST_METHOD0(GetOpened, bool()); | 153 MOCK_CONST_METHOD0(GetOpened, bool()); |
154 MOCK_CONST_METHOD0(GetLastModifiedTime, const std::string&()); | 154 MOCK_CONST_METHOD0(GetLastModifiedTime, const std::string&()); |
155 MOCK_CONST_METHOD0(GetETag, const std::string&()); | 155 MOCK_CONST_METHOD0(GetETag, const std::string&()); |
156 MOCK_CONST_METHOD0(GetLastReason, DownloadInterruptReason()); | 156 MOCK_CONST_METHOD0(GetLastReason, DownloadInterruptReason()); |
157 MOCK_CONST_METHOD0(GetPersistentStoreInfo, | 157 MOCK_CONST_METHOD0(GetPersistentStoreInfo, |
158 content::DownloadPersistentStoreInfo()); | 158 content::DownloadPersistentStoreInfo()); |
159 MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*()); | 159 MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*()); |
160 MOCK_CONST_METHOD0(GetWebContents, content::WebContents*()); | 160 MOCK_CONST_METHOD0(GetWebContents, content::WebContents*()); |
| 161 MOCK_METHOD1(SetShouldShowInDownloadsUI, void(bool)); |
| 162 MOCK_CONST_METHOD0(ShouldShowInDownloadsUI, bool()); |
161 MOCK_CONST_METHOD0(GetFileNameToReportUser, FilePath()); | 163 MOCK_CONST_METHOD0(GetFileNameToReportUser, FilePath()); |
162 MOCK_METHOD1(SetDisplayName, void(const FilePath&)); | 164 MOCK_METHOD1(SetDisplayName, void(const FilePath&)); |
163 MOCK_CONST_METHOD0(GetUserVerifiedFilePath, FilePath()); | 165 MOCK_CONST_METHOD0(GetUserVerifiedFilePath, FilePath()); |
164 MOCK_METHOD0(OffThreadCancel, void()); | 166 MOCK_METHOD0(OffThreadCancel, void()); |
165 MOCK_CONST_METHOD1(DebugString, std::string(bool)); | 167 MOCK_CONST_METHOD1(DebugString, std::string(bool)); |
166 MOCK_METHOD0(MockDownloadOpenForTesting, void()); | 168 MOCK_METHOD0(MockDownloadOpenForTesting, void()); |
167 }; | 169 }; |
168 | 170 |
169 class MockDownloadManagerDelegate : public content::DownloadManagerDelegate { | 171 class MockDownloadManagerDelegate : public content::DownloadManagerDelegate { |
170 public: | 172 public: |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 MockDownloadItemImpl& item(AddItemToManager()); | 618 MockDownloadItemImpl& item(AddItemToManager()); |
617 int download_id = item.GetId(); | 619 int download_id = item.GetId(); |
618 | 620 |
619 content::DownloadInterruptReason reason( | 621 content::DownloadInterruptReason reason( |
620 content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED); | 622 content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED); |
621 | 623 |
622 EXPECT_CALL(item, Interrupt(reason)); | 624 EXPECT_CALL(item, Interrupt(reason)); |
623 download_manager_->OnDownloadInterrupted(download_id, reason); | 625 download_manager_->OnDownloadInterrupted(download_id, reason); |
624 EXPECT_EQ(&item, download_manager_->GetDownload(download_id)); | 626 EXPECT_EQ(&item, download_manager_->GetDownload(download_id)); |
625 } | 627 } |
OLD | NEW |