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

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

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Pull in upstream changes. Created 6 years, 9 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "components/autofill/core/browser/webdata/autofill_change.h" 44 #include "components/autofill/core/browser/webdata/autofill_change.h"
45 #include "components/autofill/core/browser/webdata/autofill_entry.h" 45 #include "components/autofill/core/browser/webdata/autofill_entry.h"
46 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" 46 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h"
47 #include "components/autofill/core/browser/webdata/autofill_table.h" 47 #include "components/autofill/core/browser/webdata/autofill_table.h"
48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
49 #include "components/sync_driver/data_type_controller.h" 49 #include "components/sync_driver/data_type_controller.h"
50 #include "components/webdata/common/web_data_service_test_util.h" 50 #include "components/webdata/common/web_data_service_test_util.h"
51 #include "components/webdata/common/web_database.h" 51 #include "components/webdata/common/web_database.h"
52 #include "content/public/test/test_browser_thread.h" 52 #include "content/public/test/test_browser_thread.h"
53 #include "google_apis/gaia/gaia_constants.h" 53 #include "google_apis/gaia/gaia_constants.h"
54 #include "sync/api/attachments/fake_attachment_service.h"
54 #include "sync/internal_api/public/base/model_type.h" 55 #include "sync/internal_api/public/base/model_type.h"
55 #include "sync/internal_api/public/data_type_debug_info_listener.h" 56 #include "sync/internal_api/public/data_type_debug_info_listener.h"
56 #include "sync/internal_api/public/read_node.h" 57 #include "sync/internal_api/public/read_node.h"
57 #include "sync/internal_api/public/read_transaction.h" 58 #include "sync/internal_api/public/read_transaction.h"
58 #include "sync/internal_api/public/write_node.h" 59 #include "sync/internal_api/public/write_node.h"
59 #include "sync/internal_api/public/write_transaction.h" 60 #include "sync/internal_api/public/write_transaction.h"
60 #include "sync/protocol/autofill_specifics.pb.h" 61 #include "sync/protocol/autofill_specifics.pb.h"
61 #include "sync/syncable/mutable_entry.h" 62 #include "sync/syncable/mutable_entry.h"
62 #include "sync/syncable/syncable_write_transaction.h" 63 #include "sync/syncable/syncable_write_transaction.h"
63 #include "sync/test/engine/test_id_factory.h" 64 #include "sync/test/engine/test_id_factory.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 arg4, 363 arg4,
363 arg5); 364 arg5);
364 } 365 }
365 366
366 ACTION(MakeGenericChangeProcessor) { 367 ACTION(MakeGenericChangeProcessor) {
367 syncer::UserShare* user_share = arg0->GetUserShare(); 368 syncer::UserShare* user_share = arg0->GetUserShare();
368 return new GenericChangeProcessor( 369 return new GenericChangeProcessor(
369 arg1, 370 arg1,
370 arg2, 371 arg2,
371 arg3, 372 arg3,
372 user_share); 373 user_share,
374 syncer::FakeAttachmentService::CreateForTest());
373 } 375 }
374 376
375 ACTION(MakeSharedChangeProcessor) { 377 ACTION(MakeSharedChangeProcessor) {
376 return new SharedChangeProcessor(); 378 return new SharedChangeProcessor();
377 } 379 }
378 380
379 ACTION_P(MakeAutofillProfileSyncComponents, wds) { 381 ACTION_P(MakeAutofillProfileSyncComponents, wds) {
380 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); 382 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
381 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) 383 if (!BrowserThread::CurrentlyOn(BrowserThread::DB))
382 return base::WeakPtr<syncer::SyncableService>(); 384 return base::WeakPtr<syncer::SyncableService>();
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 std::vector<AutofillEntry> sync_entries; 1419 std::vector<AutofillEntry> sync_entries;
1418 std::vector<AutofillProfile> sync_profiles; 1420 std::vector<AutofillProfile> sync_profiles;
1419 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1421 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1420 EXPECT_EQ(3U, sync_entries.size()); 1422 EXPECT_EQ(3U, sync_entries.size());
1421 EXPECT_EQ(0U, sync_profiles.size()); 1423 EXPECT_EQ(0U, sync_profiles.size());
1422 for (size_t i = 0; i < sync_entries.size(); i++) { 1424 for (size_t i = 0; i < sync_entries.size(); i++) {
1423 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1425 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1424 << ", " << sync_entries[i].key().value(); 1426 << ", " << sync_entries[i].key().value();
1425 } 1427 }
1426 } 1428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698