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