1// Copyright 2013 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#ifndef TESTS_NACL_IO_TEST_MOCK_FS_H_
6#define TESTS_NACL_IO_TEST_MOCK_FS_H_
7
8#include "gmock/gmock.h"
9
10#include "nacl_io/filesystem.h"
11
12class MockFs : public nacl_io::Filesystem {
13 public:
14  typedef nacl_io::Error Error;
15  typedef nacl_io::FsInitArgs FsInitArgs;
16  typedef nacl_io::Path Path;
17  typedef nacl_io::PepperInterface PepperInterface;
18  typedef nacl_io::ScopedNode ScopedNode;
19  typedef nacl_io::StringMap_t StringMap_t;
20
21  MockFs();
22  virtual ~MockFs();
23
24  MOCK_METHOD1(Init, Error(const FsInitArgs&));
25  MOCK_METHOD0(Destroy, void());
26  MOCK_METHOD2(Access, Error(const Path&, int));
27  MOCK_METHOD3(Open, Error(const Path&, int, ScopedNode*));
28  MOCK_METHOD4(OpenWithMode, Error(const Path&, int, mode_t, ScopedNode*));
29  MOCK_METHOD2(OpenResource, Error(const Path&, ScopedNode*));
30  MOCK_METHOD1(Unlink, Error(const Path&));
31  MOCK_METHOD2(Mkdir, Error(const Path&, int));
32  MOCK_METHOD1(Rmdir, Error(const Path&));
33  MOCK_METHOD1(Remove, Error(const Path&));
34  MOCK_METHOD2(Rename, Error(const Path&, const Path&));
35};
36
37#endif  // TESTS_NACL_IO_TEST_MOCK_FS_H_
38