| 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 #include "net/base/mock_file_stream.h" |   5 #include "net/base/mock_file_stream.h" | 
|   6  |   6  | 
|   7 namespace net { |   7 namespace net { | 
|   8  |   8  | 
|   9 namespace testing { |   9 namespace testing { | 
|  10  |  10  | 
|  11 int MockFileStream::OpenSync(const FilePath& path, int open_flags) { |  11 int MockFileStream::OpenSync(const FilePath& path, int open_flags) { | 
|  12   path_ = path; |  12   path_ = path; | 
|  13   return ReturnError(FileStream::OpenSync(path, open_flags)); |  13   return ReturnError(FileStream::OpenSync(path, open_flags)); | 
|  14 } |  14 } | 
|  15  |  15  | 
|  16 int64 MockFileStream::Seek(Whence whence, int64 offset) { |  16 int MockFileStream::Seek(Whence whence, int64 offset, | 
|  17   return ReturnError64(FileStream::Seek(whence, offset)); |  17                          const Int64CompletionCallback& callback) { | 
 |  18   return ReturnError(FileStream::Seek(whence, offset, callback)); | 
 |  19 } | 
 |  20  | 
 |  21 int64 MockFileStream::SeekSync(Whence whence, int64 offset) { | 
 |  22   return ReturnError64(FileStream::SeekSync(whence, offset)); | 
|  18 } |  23 } | 
|  19  |  24  | 
|  20 int64 MockFileStream::Available() { |  25 int64 MockFileStream::Available() { | 
|  21   return ReturnError64(FileStream::Available()); |  26   return ReturnError64(FileStream::Available()); | 
|  22 } |  27 } | 
|  23  |  28  | 
|  24 int MockFileStream::Read(IOBuffer* buf, |  29 int MockFileStream::Read(IOBuffer* buf, | 
|  25                          int buf_len, |  30                          int buf_len, | 
|  26                          const CompletionCallback& callback) { |  31                          const CompletionCallback& callback) { | 
|  27   return ReturnError(FileStream::Read(buf, buf_len, callback)); |  32   return ReturnError(FileStream::Read(buf, buf_len, callback)); | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|  49   return ReturnError64(FileStream::Truncate(bytes)); |  54   return ReturnError64(FileStream::Truncate(bytes)); | 
|  50 } |  55 } | 
|  51  |  56  | 
|  52 int MockFileStream::Flush() { |  57 int MockFileStream::Flush() { | 
|  53   return ReturnError(FileStream::Flush()); |  58   return ReturnError(FileStream::Flush()); | 
|  54 } |  59 } | 
|  55  |  60  | 
|  56 }  // namespace testing |  61 }  // namespace testing | 
|  57  |  62  | 
|  58 }  // namespace net |  63 }  // namespace net | 
| OLD | NEW |