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_PROFILE_SYNC_SERVICE_MOCK_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "chrome/browser/sync/glue/change_processor.h" | 13 #include "chrome/browser/sync/glue/change_processor.h" |
14 #include "chrome/browser/sync/glue/data_type_controller.h" | 14 #include "chrome/browser/sync/glue/data_type_controller.h" |
15 #include "chrome/browser/sync/glue/device_info.h" | 15 #include "chrome/browser/sync/glue/device_info.h" |
16 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
18 #include "google_apis/gaia/google_service_auth_error.h" | 18 #include "google_apis/gaia/google_service_auth_error.h" |
19 #include "sync/internal_api/public/base/model_type.h" | 19 #include "sync/internal_api/public/base/model_type.h" |
20 #include "sync/protocol/sync_protocol_error.h" | 20 #include "sync/protocol/sync_protocol_error.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
22 | 22 |
23 using ::testing::Invoke; | 23 using ::testing::Invoke; |
24 | 24 |
25 class ProfileSyncServiceMock : public ProfileSyncService { | 25 class ProfileSyncServiceMock : public ProfileSyncService { |
26 public: | 26 public: |
27 // no-arg constructor provided so TestingProfile can use NiceMock. | |
28 ProfileSyncServiceMock(); | |
29 explicit ProfileSyncServiceMock(Profile* profile); | 27 explicit ProfileSyncServiceMock(Profile* profile); |
30 virtual ~ProfileSyncServiceMock(); | 28 virtual ~ProfileSyncServiceMock(); |
31 | 29 |
32 // A utility used by sync tests to create a TestingProfile with a Google | 30 // A utility used by sync tests to create a TestingProfile with a Google |
33 // Services username stored in a (Testing)PrefService. | 31 // Services username stored in a (Testing)PrefService. |
34 static TestingProfile* MakeSignedInTestingProfile(); | 32 static TestingProfile* MakeSignedInTestingProfile(); |
35 | 33 |
36 // Helper routine to be used in conjunction with | 34 // Helper routine to be used in conjunction with |
37 // BrowserContextKeyedServiceFactory::SetTestingFactory(). | 35 // BrowserContextKeyedServiceFactory::SetTestingFactory(). |
38 static BrowserContextKeyedService* BuildMockProfileSyncService( | 36 static BrowserContextKeyedService* BuildMockProfileSyncService( |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); | 121 MOCK_CONST_METHOD0(GetPassphraseType, syncer::PassphraseType()); |
124 MOCK_CONST_METHOD0(GetPassphraseTime, base::Time()); | 122 MOCK_CONST_METHOD0(GetPassphraseTime, base::Time()); |
125 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); | 123 MOCK_CONST_METHOD0(GetExplicitPassphraseTime, base::Time()); |
126 | 124 |
127 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); | 125 MOCK_METHOD1(SetDecryptionPassphrase, bool(const std::string& passphrase)); |
128 MOCK_METHOD2(SetEncryptionPassphrase, void(const std::string& passphrase, | 126 MOCK_METHOD2(SetEncryptionPassphrase, void(const std::string& passphrase, |
129 PassphraseType type)); | 127 PassphraseType type)); |
130 }; | 128 }; |
131 | 129 |
132 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ | 130 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_ |
OLD | NEW |