OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ |
6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | 6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/browser/sync/syncable/syncable.h" | 11 #include "chrome/browser/sync/syncable/syncable.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using syncable::Directory; | 15 using syncable::Directory; |
16 using syncable::EntryKernel; | 16 using syncable::EntryKernel; |
17 | 17 |
18 class MockDirectory : public Directory { | 18 class MockDirectory : public Directory { |
19 public: | 19 public: |
20 MockDirectory() { | 20 MockDirectory(); |
21 init_kernel("myk"); | 21 virtual ~MockDirectory(); |
22 } | 22 |
23 MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64)); | 23 MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64)); |
24 | 24 |
25 MOCK_METHOD2(set_last_downloadstamp, void(syncable::ModelType, int64)); | 25 MOCK_METHOD2(set_last_downloadstamp, void(syncable::ModelType, int64)); |
26 | 26 |
27 MOCK_METHOD1(GetEntryByClientTag, | 27 MOCK_METHOD1(GetEntryByClientTag, |
28 syncable::EntryKernel*(const std::string&)); | 28 syncable::EntryKernel*(const std::string&)); |
29 }; | 29 }; |
30 | 30 |
31 class MockSyncableWriteTransaction : public syncable::WriteTransaction { | 31 class MockSyncableWriteTransaction : public syncable::WriteTransaction { |
32 public: | 32 public: |
33 explicit MockSyncableWriteTransaction(Directory *directory) : | 33 explicit MockSyncableWriteTransaction(Directory *directory); |
34 WriteTransaction(directory, syncable::UNITTEST, "dontcare.cpp", 25) { | |
35 } | |
36 }; | 34 }; |
37 | 35 |
38 | 36 |
39 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ | 37 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_MOCK_H_ |
40 | 38 |
OLD | NEW |