Extract SIGPIPE ignoring code to a common place.
[chromium-blink-merge.git] / sync / syncable / syncable_mock.h
blobeb4ac27c52958fe3fcdb1a800aba84d537360dc5
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 #ifndef SYNC_SYNCABLE_SYNCABLE_MOCK_H_
6 #define SYNC_SYNCABLE_SYNCABLE_MOCK_H_
8 #include <string>
10 #include "sync/syncable/directory.h"
11 #include "sync/syncable/write_transaction.h"
12 #include "sync/test/null_directory_change_delegate.h"
13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h"
16 namespace syncer {
17 namespace syncable {
19 class MockDirectory : public Directory {
20 public:
21 explicit MockDirectory(UnrecoverableErrorHandler* handler);
22 virtual ~MockDirectory();
24 MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64));
26 MOCK_METHOD2(set_last_downloadstamp, void(ModelType, int64));
28 MOCK_METHOD1(GetEntryByClientTag,
29 syncable::EntryKernel*(const std::string&));
31 MOCK_METHOD1(PurgeEntriesWithTypeIn, bool(ModelTypeSet));
33 private:
34 syncable::NullDirectoryChangeDelegate delegate_;
37 class MockSyncableWriteTransaction : public syncable::WriteTransaction {
38 public:
39 MockSyncableWriteTransaction(
40 const tracked_objects::Location& from_here, Directory *directory);
43 } // namespace syncable
44 } // namespace syncer
46 #endif // SYNC_SYNCABLE_SYNCABLE_MOCK_H_