OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | |
6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "chrome/browser/sync/syncable/syncable.h" | |
12 #include "chrome/browser/sync/test/fake_encryptor.h" | |
13 #include "chrome/browser/sync/test/null_directory_change_delegate.h" | |
14 #include "testing/gmock/include/gmock/gmock.h" | |
15 #include "testing/gtest/include/gtest/gtest.h" | |
16 | |
17 using syncable::Directory; | |
18 using syncable::EntryKernel; | |
19 | |
20 class MockDirectory : public Directory { | |
21 public: | |
22 explicit MockDirectory(browser_sync::UnrecoverableErrorHandler* handler); | |
23 virtual ~MockDirectory(); | |
24 | |
25 MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64)); | |
26 | |
27 MOCK_METHOD2(set_last_downloadstamp, void(syncable::ModelType, int64)); | |
28 | |
29 MOCK_METHOD1(GetEntryByClientTag, | |
30 syncable::EntryKernel*(const std::string&)); | |
31 | |
32 MOCK_METHOD1(PurgeEntriesWithTypeIn, void(syncable::ModelTypeSet)); | |
33 | |
34 private: | |
35 browser_sync::FakeEncryptor encryptor_; | |
36 syncable::NullDirectoryChangeDelegate delegate_; | |
37 }; | |
38 | |
39 class MockSyncableWriteTransaction : public syncable::WriteTransaction { | |
40 public: | |
41 MockSyncableWriteTransaction( | |
42 const tracked_objects::Location& from_here, Directory *directory); | |
43 }; | |
44 | |
45 | |
46 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | |
47 | |
OLD | NEW |