Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/browser/download/download_job.h" | 11 #include "content/browser/download/download_job.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class DownloadItemImpl; | |
| 18 | |
| 17 class MockDownloadJob : public DownloadJob { | 19 class MockDownloadJob : public DownloadJob { |
| 18 public: | 20 public: |
| 19 MockDownloadJob(); | 21 MockDownloadJob(DownloadItemImpl* download_item); |
|
qinmin
2017/02/22 19:51:23
explicit
xingliu
2017/02/22 21:22:41
Done.
| |
| 20 ~MockDownloadJob() override; | 22 ~MockDownloadJob() override; |
| 21 | 23 |
| 24 DownloadItemImpl* download_item() { return download_item_; } | |
| 25 | |
| 22 // DownloadJob implementation. | 26 // DownloadJob implementation. |
| 27 MOCK_METHOD0(Start, void()); | |
| 23 MOCK_METHOD1(Cancel, void(bool)); | 28 MOCK_METHOD1(Cancel, void(bool)); |
| 24 MOCK_METHOD0(Pause, void()); | 29 MOCK_METHOD0(Pause, void()); |
| 25 MOCK_METHOD0(Resume, void()); | 30 MOCK_METHOD0(Resume, void()); |
| 26 MOCK_CONST_METHOD0(CanOpen, bool()); | 31 MOCK_CONST_METHOD0(CanOpen, bool()); |
| 27 MOCK_CONST_METHOD0(CanResume, bool()); | 32 MOCK_CONST_METHOD0(CanResume, bool()); |
| 28 MOCK_CONST_METHOD0(CanShowInFolder, bool()); | 33 MOCK_CONST_METHOD0(CanShowInFolder, bool()); |
| 29 MOCK_CONST_METHOD0(IsActive, bool()); | 34 MOCK_CONST_METHOD0(IsActive, bool()); |
| 30 MOCK_CONST_METHOD0(IsPaused, bool()); | 35 MOCK_CONST_METHOD0(IsPaused, bool()); |
| 31 MOCK_CONST_METHOD0(PercentComplete, int()); | 36 MOCK_CONST_METHOD0(PercentComplete, int()); |
| 32 MOCK_CONST_METHOD0(CurrentSpeed, int64_t()); | 37 MOCK_CONST_METHOD0(CurrentSpeed, int64_t()); |
| 33 MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta* remaining)); | 38 MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta* remaining)); |
| 34 MOCK_CONST_METHOD0(GetWebContents, WebContents*()); | 39 MOCK_CONST_METHOD0(GetWebContents, WebContents*()); |
| 35 MOCK_CONST_METHOD1(DebugString, std::string(bool)); | 40 MOCK_CONST_METHOD1(DebugString, std::string(bool)); |
| 36 }; | 41 }; |
| 37 | 42 |
| 38 } // namespace content | 43 } // namespace content |
| 39 | 44 |
| 40 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ | 45 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_JOB_H_ |
| OLD | NEW |