Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: chrome/browser/sync/profile_sync_service_autofill_unittest.cc

Issue 10662035: [Sync] Put everything in sync/api into csync namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698