| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "base/prefs/pref_registry_simple.h" | 5 #include "base/prefs/pref_registry_simple.h" |
| 6 #include "base/prefs/testing_pref_service.h" | 6 #include "base/prefs/testing_pref_service.h" |
| 7 #include "components/autofill/core/browser/autofill_test_utils.h" | 7 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 8 #include "components/autofill/core/browser/options_util.h" | 8 #include "components/autofill/core/browser/options_util.h" |
| 9 #include "components/autofill/core/browser/test_personal_data_manager.h" | 9 #include "components/autofill/core/browser/test_personal_data_manager.h" |
| 10 #include "components/autofill/core/common/autofill_pref_names.h" | 10 #include "components/autofill/core/common/autofill_pref_names.h" |
| 11 #include "components/sync_driver/data_type_manager.h" | 11 #include "components/sync_driver/data_type_manager.h" |
| 12 #include "components/sync_driver/sync_service.h" | 12 #include "components/sync_driver/sync_service.h" |
| 13 #include "google_apis/gaia/google_service_auth_error.h" | 13 #include "google_apis/gaia/google_service_auth_error.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 15 | 15 |
| 16 using testing::Return; | 16 using testing::Return; |
| 17 | 17 |
| 18 namespace autofill { | 18 namespace autofill { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class SyncServiceMock : public sync_driver::SyncService { | 22 class SyncServiceMock : public sync_driver::SyncService { |
| 23 public: | 23 public: |
| 24 MOCK_CONST_METHOD0(HasSyncSetupCompleted, bool()); | 24 MOCK_CONST_METHOD0(HasSyncSetupCompleted, bool()); |
| 25 MOCK_CONST_METHOD0(SyncActive, bool()); | 25 MOCK_CONST_METHOD0(IsSyncActive, bool()); |
| 26 MOCK_CONST_METHOD0(GetActiveDataTypes, syncer::ModelTypeSet()); | 26 MOCK_CONST_METHOD0(GetActiveDataTypes, syncer::ModelTypeSet()); |
| 27 MOCK_METHOD1(AddObserver, void(sync_driver::SyncServiceObserver*)); | 27 MOCK_METHOD1(AddObserver, void(sync_driver::SyncServiceObserver*)); |
| 28 MOCK_METHOD1(RemoveObserver, void(sync_driver::SyncServiceObserver*)); | 28 MOCK_METHOD1(RemoveObserver, void(sync_driver::SyncServiceObserver*)); |
| 29 MOCK_CONST_METHOD1(HasObserver, | 29 MOCK_CONST_METHOD1(HasObserver, |
| 30 bool(const sync_driver::SyncServiceObserver*)); | 30 bool(const sync_driver::SyncServiceObserver*)); |
| 31 MOCK_METHOD0(IsSyncEnabledAndLoggedIn, bool()); | 31 MOCK_METHOD0(IsSyncEnabledAndLoggedIn, bool()); |
| 32 MOCK_METHOD0(DisableForUser, void()); | 32 MOCK_METHOD0(DisableForUser, void()); |
| 33 MOCK_METHOD0(StopAndSuppress, void()); | 33 MOCK_METHOD0(StopAndSuppress, void()); |
| 34 MOCK_METHOD0(UnsuppressAndStart, void()); | 34 MOCK_METHOD0(UnsuppressAndStart, void()); |
| 35 MOCK_CONST_METHOD0(GetPreferredDataTypes, syncer::ModelTypeSet()); | 35 MOCK_CONST_METHOD0(GetPreferredDataTypes, syncer::ModelTypeSet()); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 scoped_ptr<TestingPrefServiceSimple> prefs = | 190 scoped_ptr<TestingPrefServiceSimple> prefs = |
| 191 CreatePrefService(true, true, true); | 191 CreatePrefService(true, true, true); |
| 192 // Set server data as missing. | 192 // Set server data as missing. |
| 193 scoped_ptr<TestPersonalDataManager> pdm = | 193 scoped_ptr<TestPersonalDataManager> pdm = |
| 194 CreatePersonalDataManager(prefs.get(), false); | 194 CreatePersonalDataManager(prefs.get(), false); |
| 195 | 195 |
| 196 EXPECT_TRUE(WalletIntegrationAvailable(sync.get(), *prefs, *pdm)); | 196 EXPECT_TRUE(WalletIntegrationAvailable(sync.get(), *prefs, *pdm)); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace autofill | 199 } // namespace autofill |
| OLD | NEW |