| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
| 12 #include <string> | 13 #include <string> |
| 13 | 14 |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "content/browser/byte_stream.h" |
| 16 #include "content/browser/download/download_file.h" | 18 #include "content/browser/download/download_file.h" |
| 17 #include "content/public/browser/download_manager.h" | 19 #include "content/public/browser/download_manager.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 22 |
| 21 namespace content { | 23 namespace content { |
| 22 | 24 |
| 23 class MockDownloadFile : public DownloadFile { | 25 class MockDownloadFile : public DownloadFile { |
| 24 public: | 26 public: |
| 25 MockDownloadFile(); | 27 MockDownloadFile(); |
| 26 virtual ~MockDownloadFile(); | 28 virtual ~MockDownloadFile(); |
| 27 | 29 |
| 28 // DownloadFile functions. | 30 // DownloadFile functions. |
| 29 MOCK_METHOD1(Initialize, void(const InitializeCallback&)); | 31 MOCK_METHOD1(Initialize, void(const InitializeCallback&)); |
| 32 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, |
| 33 int64_t offset) override; |
| 34 MOCK_METHOD2(DoAddByteStream, |
| 35 void(ByteStreamReader* stream_reader, int64_t offset)); |
| 30 MOCK_METHOD2(AppendDataToFile, DownloadInterruptReason( | 36 MOCK_METHOD2(AppendDataToFile, DownloadInterruptReason( |
| 31 const char* data, size_t data_len)); | 37 const char* data, size_t data_len)); |
| 32 MOCK_METHOD1(Rename, DownloadInterruptReason( | 38 MOCK_METHOD1(Rename, DownloadInterruptReason( |
| 33 const base::FilePath& full_path)); | 39 const base::FilePath& full_path)); |
| 34 MOCK_METHOD2(RenameAndUniquify, | 40 MOCK_METHOD2(RenameAndUniquify, |
| 35 void(const base::FilePath& full_path, | 41 void(const base::FilePath& full_path, |
| 36 const RenameCompletionCallback& callback)); | 42 const RenameCompletionCallback& callback)); |
| 37 MOCK_METHOD5(RenameAndAnnotate, | 43 MOCK_METHOD5(RenameAndAnnotate, |
| 38 void(const base::FilePath& full_path, | 44 void(const base::FilePath& full_path, |
| 39 const std::string& client_guid, | 45 const std::string& client_guid, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 50 MOCK_METHOD1(GetHash, bool(std::string* hash)); | 56 MOCK_METHOD1(GetHash, bool(std::string* hash)); |
| 51 MOCK_METHOD0(SendUpdate, void()); | 57 MOCK_METHOD0(SendUpdate, void()); |
| 52 MOCK_CONST_METHOD0(Id, int()); | 58 MOCK_CONST_METHOD0(Id, int()); |
| 53 MOCK_METHOD0(GetDownloadManager, DownloadManager*()); | 59 MOCK_METHOD0(GetDownloadManager, DownloadManager*()); |
| 54 MOCK_CONST_METHOD0(DebugString, std::string()); | 60 MOCK_CONST_METHOD0(DebugString, std::string()); |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 } // namespace content | 63 } // namespace content |
| 58 | 64 |
| 59 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ | 65 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_FILE_H_ |
| OLD | NEW |