Chromium Code Reviews| 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 #include "base/basictypes.h" | |
| 8 #include "base/file_path.h" | |
| 9 #include "net/base/net_errors.h" | |
|
wtc
2011/08/29 18:17:05
Remove these three headers. They are already incl
ahendrickson
2011/08/29 19:42:38
Done.
| |
| 10 | |
| 11 namespace testing { | |
| 12 | |
| 13 int MockFileStream::Open(const FilePath& path, int open_flags) { | |
| 14 path_ = path; | |
| 15 return ReturnError(net::FileStream::Open(path, open_flags)); | |
| 16 } | |
| 17 | |
| 18 int64 MockFileStream::Seek(net::Whence whence, int64 offset) { | |
| 19 return ReturnError64(net::FileStream::Seek(whence, offset)); | |
| 20 } | |
| 21 | |
| 22 int64 MockFileStream::Available() { | |
| 23 return ReturnError64(net::FileStream::Available()); | |
| 24 } | |
| 25 | |
| 26 int MockFileStream::Read(char* buf, | |
| 27 int buf_len, | |
| 28 net::CompletionCallback* callback) { | |
| 29 return ReturnError(net::FileStream::Read(buf, buf_len, callback)); | |
| 30 } | |
| 31 | |
| 32 int MockFileStream::ReadUntilComplete(char *buf, int buf_len) { | |
| 33 return ReturnError(net::FileStream::ReadUntilComplete(buf, buf_len)); | |
| 34 } | |
| 35 | |
| 36 int MockFileStream::Write(const char* buf, | |
| 37 int buf_len, | |
| 38 net::CompletionCallback* callback) { | |
| 39 return ReturnError(net::FileStream::Write(buf, buf_len, callback)); | |
| 40 } | |
| 41 | |
| 42 int64 MockFileStream::Truncate(int64 bytes) { | |
| 43 return ReturnError64(net::FileStream::Truncate(bytes)); | |
| 44 } | |
| 45 | |
| 46 int MockFileStream::Flush() { | |
| 47 return ReturnError(net::FileStream::Flush()); | |
| 48 } | |
| 49 | |
| 50 } // namespace testing | |
| OLD | NEW |