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 CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ |
6 #define CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ | 6 #define CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ |
7 #pragma once | |
8 | 7 |
9 #include "base/location.h" | 8 #include "base/location.h" |
10 #include "chrome/browser/sync/glue/model_associator.h" | 9 #include "chrome/browser/sync/glue/model_associator.h" |
11 #include "sync/api/sync_error.h" | 10 #include "sync/api/sync_error.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
13 | 12 |
14 namespace browser_sync { | 13 namespace browser_sync { |
15 | 14 |
16 ACTION_P(SetSyncError, type) { | 15 ACTION_P(SetSyncError, type) { |
17 arg0->Reset(FROM_HERE, "test", type); | 16 arg0->Reset(FROM_HERE, "test", type); |
18 } | 17 } |
19 | 18 |
20 class ModelAssociatorMock : public AssociatorInterface { | 19 class ModelAssociatorMock : public AssociatorInterface { |
21 public: | 20 public: |
22 ModelAssociatorMock(); | 21 ModelAssociatorMock(); |
23 virtual ~ModelAssociatorMock(); | 22 virtual ~ModelAssociatorMock(); |
24 | 23 |
25 MOCK_METHOD0(AssociateModels, syncer::SyncError()); | 24 MOCK_METHOD0(AssociateModels, syncer::SyncError()); |
26 MOCK_METHOD0(DisassociateModels, syncer::SyncError()); | 25 MOCK_METHOD0(DisassociateModels, syncer::SyncError()); |
27 MOCK_METHOD1(SyncModelHasUserCreatedNodes, bool(bool* has_nodes)); | 26 MOCK_METHOD1(SyncModelHasUserCreatedNodes, bool(bool* has_nodes)); |
28 MOCK_METHOD0(AbortAssociation, void()); | 27 MOCK_METHOD0(AbortAssociation, void()); |
29 MOCK_METHOD0(CryptoReadyIfNecessary, bool()); | 28 MOCK_METHOD0(CryptoReadyIfNecessary, bool()); |
30 }; | 29 }; |
31 | 30 |
32 } // namespace browser_sync | 31 } // namespace browser_sync |
33 | 32 |
34 #endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ | 33 #endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_MOCK_H__ |
OLD | NEW |