OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/base/mock_file_stream.h" |
| 6 |
| 7 namespace net { |
| 8 |
| 9 namespace testing { |
| 10 |
| 11 int MockFileStream::Open(const FilePath& path, int open_flags) { |
| 12 path_ = path; |
| 13 return ReturnError(net::FileStream::Open(path, open_flags)); |
| 14 } |
| 15 |
| 16 int64 MockFileStream::Seek(net::Whence whence, int64 offset) { |
| 17 return ReturnError64(net::FileStream::Seek(whence, offset)); |
| 18 } |
| 19 |
| 20 int64 MockFileStream::Available() { |
| 21 return ReturnError64(net::FileStream::Available()); |
| 22 } |
| 23 |
| 24 int MockFileStream::Read(char* buf, |
| 25 int buf_len, |
| 26 net::CompletionCallback* callback) { |
| 27 return ReturnError(net::FileStream::Read(buf, buf_len, callback)); |
| 28 } |
| 29 |
| 30 int MockFileStream::ReadUntilComplete(char *buf, int buf_len) { |
| 31 return ReturnError(net::FileStream::ReadUntilComplete(buf, buf_len)); |
| 32 } |
| 33 |
| 34 int MockFileStream::Write(const char* buf, |
| 35 int buf_len, |
| 36 net::CompletionCallback* callback) { |
| 37 return ReturnError(net::FileStream::Write(buf, buf_len, callback)); |
| 38 } |
| 39 |
| 40 int64 MockFileStream::Truncate(int64 bytes) { |
| 41 return ReturnError64(net::FileStream::Truncate(bytes)); |
| 42 } |
| 43 |
| 44 int MockFileStream::Flush() { |
| 45 return ReturnError(net::FileStream::Flush()); |
| 46 } |
| 47 |
| 48 } // namespace testing |
| 49 |
| 50 } // namespace net |
OLD | NEW |