| 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 // This file defines MockFileStream, a test class for FileStream. | 5 // This file defines MockFileStream, a test class for FileStream. |
| 6 | 6 |
| 7 #ifndef NET_BASE_MOCK_FILE_STREAM_H_ | 7 #ifndef NET_BASE_MOCK_FILE_STREAM_H_ |
| 8 #define NET_BASE_MOCK_FILE_STREAM_H_ | 8 #define NET_BASE_MOCK_FILE_STREAM_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class MockFileStream : public net::FileStream { | 23 class MockFileStream : public net::FileStream { |
| 24 public: | 24 public: |
| 25 MockFileStream(net::NetLog* net_log) | 25 MockFileStream(net::NetLog* net_log) |
| 26 : net::FileStream(net_log), forced_error_(net::OK) {} | 26 : net::FileStream(net_log), forced_error_(net::OK) {} |
| 27 | 27 |
| 28 MockFileStream(base::PlatformFile file, int flags, net::NetLog* net_log) | 28 MockFileStream(base::PlatformFile file, int flags, net::NetLog* net_log) |
| 29 : net::FileStream(file, flags, net_log), forced_error_(net::OK) {} | 29 : net::FileStream(file, flags, net_log), forced_error_(net::OK) {} |
| 30 | 30 |
| 31 // FileStream methods. | 31 // FileStream methods. |
| 32 virtual int OpenSync(const FilePath& path, int open_flags) OVERRIDE; | 32 virtual int OpenSync(const FilePath& path, int open_flags) OVERRIDE; |
| 33 virtual int64 Seek(net::Whence whence, int64 offset) OVERRIDE; | 33 virtual int Seek(net::Whence whence, int64 offset, |
| 34 const Int64CompletionCallback& callback) OVERRIDE; |
| 35 virtual int64 SeekSync(net::Whence whence, int64 offset) OVERRIDE; |
| 34 virtual int64 Available() OVERRIDE; | 36 virtual int64 Available() OVERRIDE; |
| 35 virtual int Read(IOBuffer* buf, | 37 virtual int Read(IOBuffer* buf, |
| 36 int buf_len, | 38 int buf_len, |
| 37 const CompletionCallback& callback) OVERRIDE; | 39 const CompletionCallback& callback) OVERRIDE; |
| 38 virtual int ReadSync(char* buf, int buf_len) OVERRIDE; | 40 virtual int ReadSync(char* buf, int buf_len) OVERRIDE; |
| 39 virtual int ReadUntilComplete(char *buf, int buf_len) OVERRIDE; | 41 virtual int ReadUntilComplete(char *buf, int buf_len) OVERRIDE; |
| 40 virtual int Write(IOBuffer* buf, | 42 virtual int Write(IOBuffer* buf, |
| 41 int buf_len, | 43 int buf_len, |
| 42 const CompletionCallback& callback) OVERRIDE; | 44 const CompletionCallback& callback) OVERRIDE; |
| 43 virtual int WriteSync(const char* buf, int buf_len) OVERRIDE; | 45 virtual int WriteSync(const char* buf, int buf_len) OVERRIDE; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 72 | 74 |
| 73 int forced_error_; | 75 int forced_error_; |
| 74 FilePath path_; | 76 FilePath path_; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace testing | 79 } // namespace testing |
| 78 | 80 |
| 79 } // namespace net | 81 } // namespace net |
| 80 | 82 |
| 81 #endif // NET_BASE_MOCK_FILE_STREAM_H_ | 83 #endif // NET_BASE_MOCK_FILE_STREAM_H_ |
| OLD | NEW |