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 "components/wifi_sync/wifi_credential_syncable_service.h" | 5 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 base::Time(), syncer::AttachmentIdList(), | 139 base::Time(), syncer::AttachmentIdList(), |
140 syncer::AttachmentServiceProxyForTest::Create())); | 140 syncer::AttachmentServiceProxyForTest::Create())); |
141 } | 141 } |
142 | 142 |
143 void StartSyncing() { | 143 void StartSyncing() { |
144 std::unique_ptr<FakeSyncChangeProcessor> change_processor( | 144 std::unique_ptr<FakeSyncChangeProcessor> change_processor( |
145 new FakeSyncChangeProcessor()); | 145 new FakeSyncChangeProcessor()); |
146 change_processor_ = change_processor.get(); | 146 change_processor_ = change_processor.get(); |
147 syncable_service_->MergeDataAndStartSyncing( | 147 syncable_service_->MergeDataAndStartSyncing( |
148 syncer::WIFI_CREDENTIALS, syncer::SyncDataList(), | 148 syncer::WIFI_CREDENTIALS, syncer::SyncDataList(), |
149 std::move(change_processor), | 149 std::move(change_processor), base::MakeUnique<SyncErrorFactoryMock>()); |
150 base::WrapUnique(new SyncErrorFactoryMock())); | |
151 } | 150 } |
152 | 151 |
153 private: | 152 private: |
154 std::unique_ptr<WifiCredentialSyncableService> syncable_service_; | 153 std::unique_ptr<WifiCredentialSyncableService> syncable_service_; |
155 FakeWifiConfigDelegate* config_delegate_; // Owned by |syncable_service_| | 154 FakeWifiConfigDelegate* config_delegate_; // Owned by |syncable_service_| |
156 FakeSyncChangeProcessor* change_processor_; // Owned by |syncable_service_| | 155 FakeSyncChangeProcessor* change_processor_; // Owned by |syncable_service_| |
157 | 156 |
158 DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableServiceTest); | 157 DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableServiceTest); |
159 }; | 158 }; |
160 | 159 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 MakeCredential(kSsidNonUtf8, SECURITY_CLASS_NONE, ""))); | 334 MakeCredential(kSsidNonUtf8, SECURITY_CLASS_NONE, ""))); |
336 EXPECT_EQ(1, change_processor_changes_size()); | 335 EXPECT_EQ(1, change_processor_changes_size()); |
337 EXPECT_FALSE( | 336 EXPECT_FALSE( |
338 AddToSyncedNetworks( | 337 AddToSyncedNetworks( |
339 "fake-item-id", | 338 "fake-item-id", |
340 MakeCredential(kSsidNonUtf8, SECURITY_CLASS_NONE, ""))); | 339 MakeCredential(kSsidNonUtf8, SECURITY_CLASS_NONE, ""))); |
341 EXPECT_EQ(1, change_processor_changes_size()); | 340 EXPECT_EQ(1, change_processor_changes_size()); |
342 } | 341 } |
343 | 342 |
344 } // namespace wifi_sync | 343 } // namespace wifi_sync |
OLD | NEW |