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
3 // found in the LICENSE file.
5 #include "net/base/mock_file_stream.h"
11 int MockFileStream::OpenSync(const base::FilePath
& path
, int open_flags
) {
13 return ReturnError(FileStream::OpenSync(path
, open_flags
));
16 int MockFileStream::Seek(Whence whence
, int64 offset
,
17 const Int64CompletionCallback
& callback
) {
18 return ReturnError(FileStream::Seek(whence
, offset
, callback
));
21 int64
MockFileStream::SeekSync(Whence whence
, int64 offset
) {
22 return ReturnError64(FileStream::SeekSync(whence
, offset
));
25 int64
MockFileStream::Available() {
26 return ReturnError64(FileStream::Available());
29 int MockFileStream::Read(IOBuffer
* buf
,
31 const CompletionCallback
& callback
) {
32 return ReturnError(FileStream::Read(buf
, buf_len
, callback
));
35 int MockFileStream::ReadSync(char* buf
, int buf_len
) {
36 return ReturnError(FileStream::ReadSync(buf
, buf_len
));
39 int MockFileStream::ReadUntilComplete(char *buf
, int buf_len
) {
40 return ReturnError(FileStream::ReadUntilComplete(buf
, buf_len
));
43 int MockFileStream::Write(IOBuffer
* buf
,
45 const CompletionCallback
& callback
) {
46 return ReturnError(FileStream::Write(buf
, buf_len
, callback
));
49 int MockFileStream::WriteSync(const char* buf
, int buf_len
) {
50 return ReturnError(FileStream::WriteSync(buf
, buf_len
));
53 int64
MockFileStream::Truncate(int64 bytes
) {
54 return ReturnError64(FileStream::Truncate(bytes
));
57 int MockFileStream::Flush(const CompletionCallback
& callback
) {
58 return ReturnError(FileStream::Flush(callback
));
61 int MockFileStream::FlushSync() {
62 return ReturnError(FileStream::FlushSync());
65 } // namespace testing