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 #include <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // We own the syncable services, but don't use a |scoped_ptr| because the | 244 // We own the syncable services, but don't use a |scoped_ptr| because the |
245 // lifetime must be managed on the DB thread. | 245 // lifetime must be managed on the DB thread. |
246 AutocompleteSyncableService* autocomplete_syncable_service_; | 246 AutocompleteSyncableService* autocomplete_syncable_service_; |
247 AutofillProfileSyncableService* autofill_profile_syncable_service_; | 247 AutofillProfileSyncableService* autofill_profile_syncable_service_; |
248 WaitableEvent syncable_service_created_or_destroyed_; | 248 WaitableEvent syncable_service_created_or_destroyed_; |
249 }; | 249 }; |
250 | 250 |
251 ACTION_P(MakeAutocompleteSyncComponents, wds) { | 251 ACTION_P(MakeAutocompleteSyncComponents, wds) { |
252 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 252 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
253 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) | 253 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) |
254 return base::WeakPtr<SyncableService>(); | 254 return base::WeakPtr<csync::SyncableService>(); |
255 return wds->GetAutocompleteSyncableService()->AsWeakPtr(); | 255 return wds->GetAutocompleteSyncableService()->AsWeakPtr(); |
256 } | 256 } |
257 | 257 |
258 ACTION(MakeGenericChangeProcessor) { | 258 ACTION(MakeGenericChangeProcessor) { |
259 csync::UserShare* user_share = arg0->GetUserShare(); | 259 csync::UserShare* user_share = arg0->GetUserShare(); |
260 return new GenericChangeProcessor(arg1, arg2, user_share); | 260 return new GenericChangeProcessor(arg1, arg2, user_share); |
261 } | 261 } |
262 | 262 |
263 ACTION(MakeSharedChangeProcessor) { | 263 ACTION(MakeSharedChangeProcessor) { |
264 return new SharedChangeProcessor(); | 264 return new SharedChangeProcessor(); |
265 } | 265 } |
266 | 266 |
267 ACTION_P(MakeAutofillProfileSyncComponents, wds) { | 267 ACTION_P(MakeAutofillProfileSyncComponents, wds) { |
268 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 268 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
269 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) | 269 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) |
270 return base::WeakPtr<SyncableService>();; | 270 return base::WeakPtr<csync::SyncableService>();; |
271 return wds->GetAutofillProfileSyncableService()->AsWeakPtr(); | 271 return wds->GetAutofillProfileSyncableService()->AsWeakPtr(); |
272 } | 272 } |
273 | 273 |
274 class AbstractAutofillFactory { | 274 class AbstractAutofillFactory { |
275 public: | 275 public: |
276 virtual DataTypeController* CreateDataTypeController( | 276 virtual DataTypeController* CreateDataTypeController( |
277 ProfileSyncComponentsFactory* factory, | 277 ProfileSyncComponentsFactory* factory, |
278 ProfileMock* profile, | 278 ProfileMock* profile, |
279 ProfileSyncService* service) = 0; | 279 ProfileSyncService* service) = 0; |
280 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory, | 280 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory, |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 std::vector<AutofillEntry> sync_entries; | 1251 std::vector<AutofillEntry> sync_entries; |
1252 std::vector<AutofillProfile> sync_profiles; | 1252 std::vector<AutofillProfile> sync_profiles; |
1253 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1253 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1254 EXPECT_EQ(3U, sync_entries.size()); | 1254 EXPECT_EQ(3U, sync_entries.size()); |
1255 EXPECT_EQ(0U, sync_profiles.size()); | 1255 EXPECT_EQ(0U, sync_profiles.size()); |
1256 for (size_t i = 0; i < sync_entries.size(); i++) { | 1256 for (size_t i = 0; i < sync_entries.size(); i++) { |
1257 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1257 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1258 << ", " << sync_entries[i].key().value(); | 1258 << ", " << sync_entries[i].key().value(); |
1259 } | 1259 } |
1260 } | 1260 } |
OLD | NEW |