| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 605 |
| 606 void SetIdleChangeProcessorExpectations() { | 606 void SetIdleChangeProcessorExpectations() { |
| 607 EXPECT_CALL(autofill_table_, RemoveFormElement(_, _)).Times(0); | 607 EXPECT_CALL(autofill_table_, RemoveFormElement(_, _)).Times(0); |
| 608 EXPECT_CALL(autofill_table_, GetAutofillTimestamps(_, _, _, _)).Times(0); | 608 EXPECT_CALL(autofill_table_, GetAutofillTimestamps(_, _, _, _)).Times(0); |
| 609 | 609 |
| 610 // Only permit UpdateAutofillEntries() to be called with an empty list. | 610 // Only permit UpdateAutofillEntries() to be called with an empty list. |
| 611 std::vector<AutofillEntry> empty; | 611 std::vector<AutofillEntry> empty; |
| 612 EXPECT_CALL(autofill_table_, UpdateAutofillEntries(Not(empty))).Times(0); | 612 EXPECT_CALL(autofill_table_, UpdateAutofillEntries(Not(empty))).Times(0); |
| 613 } | 613 } |
| 614 | 614 |
| 615 sync_driver::DataTypeController* CreateDataTypeController( | 615 std::unique_ptr<sync_driver::DataTypeController> CreateDataTypeController( |
| 616 syncer::ModelType type) { | 616 syncer::ModelType type) { |
| 617 DCHECK(type == AUTOFILL || type == AUTOFILL_PROFILE); | 617 DCHECK(type == AUTOFILL || type == AUTOFILL_PROFILE); |
| 618 if (type == AUTOFILL) { | 618 if (type == AUTOFILL) { |
| 619 return new AutofillDataTypeController(base::ThreadTaskRunnerHandle::Get(), | 619 return base::MakeUnique<AutofillDataTypeController>( |
| 620 data_type_thread()->task_runner(), | 620 data_type_thread()->task_runner(), base::Bind(&base::DoNothing), |
| 621 base::Bind(&base::DoNothing), | 621 sync_client_, web_data_service_); |
| 622 sync_client_, web_data_service_); | |
| 623 } else { | 622 } else { |
| 624 return new AutofillProfileDataTypeController( | 623 return base::MakeUnique<AutofillProfileDataTypeController>( |
| 625 base::ThreadTaskRunnerHandle::Get(), | |
| 626 data_type_thread()->task_runner(), base::Bind(&base::DoNothing), | 624 data_type_thread()->task_runner(), base::Bind(&base::DoNothing), |
| 627 sync_client_, web_data_service_); | 625 sync_client_, web_data_service_); |
| 628 } | 626 } |
| 629 } | 627 } |
| 630 | 628 |
| 631 AutofillTableMock& autofill_table() { return autofill_table_; } | 629 AutofillTableMock& autofill_table() { return autofill_table_; } |
| 632 | 630 |
| 633 MockPersonalDataManager& personal_data_manager() { | 631 MockPersonalDataManager& personal_data_manager() { |
| 634 return *personal_data_manager_; | 632 return *personal_data_manager_; |
| 635 } | 633 } |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 std::vector<AutofillEntry> sync_entries; | 1478 std::vector<AutofillEntry> sync_entries; |
| 1481 std::vector<AutofillProfile> sync_profiles; | 1479 std::vector<AutofillProfile> sync_profiles; |
| 1482 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1480 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
| 1483 EXPECT_EQ(3U, sync_entries.size()); | 1481 EXPECT_EQ(3U, sync_entries.size()); |
| 1484 EXPECT_EQ(0U, sync_profiles.size()); | 1482 EXPECT_EQ(0U, sync_profiles.size()); |
| 1485 for (size_t i = 0; i < sync_entries.size(); i++) { | 1483 for (size_t i = 0; i < sync_entries.size(); i++) { |
| 1486 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1484 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
| 1487 << ", " << sync_entries[i].key().value(); | 1485 << ", " << sync_entries[i].key().value(); |
| 1488 } | 1486 } |
| 1489 } | 1487 } |
| OLD | NEW |