| 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 "base/location.h" | 5 #include "base/location.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" | 8 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" |
| 9 #include "components/autofill/core/browser/autofill_profile.h" | 9 #include "components/autofill/core/browser/autofill_profile.h" |
| 10 #include "components/autofill/core/browser/webdata/autofill_change.h" | 10 #include "components/autofill/core/browser/webdata/autofill_change.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 class MockSyncChangeProcessor : public syncer::SyncChangeProcessor { | 94 class MockSyncChangeProcessor : public syncer::SyncChangeProcessor { |
| 95 public: | 95 public: |
| 96 MockSyncChangeProcessor() {} | 96 MockSyncChangeProcessor() {} |
| 97 virtual ~MockSyncChangeProcessor() {} | 97 virtual ~MockSyncChangeProcessor() {} |
| 98 | 98 |
| 99 MOCK_METHOD2(ProcessSyncChanges, | 99 MOCK_METHOD2(ProcessSyncChanges, |
| 100 syncer::SyncError(const tracked_objects::Location&, | 100 syncer::SyncError(const tracked_objects::Location&, |
| 101 const syncer::SyncChangeList&)); | 101 const syncer::SyncChangeList&)); |
| 102 MOCK_CONST_METHOD1(GetAllSyncData, |
| 103 syncer::SyncDataList(syncer::ModelType type)); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 class TestSyncChangeProcessor : public syncer::SyncChangeProcessor { | 106 class TestSyncChangeProcessor : public syncer::SyncChangeProcessor { |
| 105 public: | 107 public: |
| 106 TestSyncChangeProcessor() {} | 108 TestSyncChangeProcessor() {} |
| 107 virtual ~TestSyncChangeProcessor() {} | 109 virtual ~TestSyncChangeProcessor() {} |
| 108 | 110 |
| 109 virtual syncer::SyncError ProcessSyncChanges( | 111 virtual syncer::SyncError ProcessSyncChanges( |
| 110 const tracked_objects::Location& location, | 112 const tracked_objects::Location& location, |
| 111 const syncer::SyncChangeList& changes) OVERRIDE { | 113 const syncer::SyncChangeList& changes) OVERRIDE { |
| 112 changes_ = changes; | 114 changes_ = changes; |
| 113 return syncer::SyncError(); | 115 return syncer::SyncError(); |
| 114 } | 116 } |
| 115 | 117 |
| 118 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const { |
| 119 return syncer::SyncDataList(); |
| 120 } |
| 121 |
| 116 const syncer::SyncChangeList& changes() { return changes_; } | 122 const syncer::SyncChangeList& changes() { return changes_; } |
| 117 | 123 |
| 118 private: | 124 private: |
| 119 syncer::SyncChangeList changes_; | 125 syncer::SyncChangeList changes_; |
| 120 }; | 126 }; |
| 121 | 127 |
| 122 class AutofillProfileSyncableServiceTest : public testing::Test { | 128 class AutofillProfileSyncableServiceTest : public testing::Test { |
| 123 public: | 129 public: |
| 124 AutofillProfileSyncableServiceTest() | 130 AutofillProfileSyncableServiceTest() |
| 125 : ui_thread_(BrowserThread::UI, &message_loop_), | 131 : ui_thread_(BrowserThread::UI, &message_loop_), |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 profile1.GetRawMultiInfo(autofill::EMAIL_ADDRESS, &values); | 662 profile1.GetRawMultiInfo(autofill::EMAIL_ADDRESS, &values); |
| 657 ASSERT_EQ(values.size(), 3U); | 663 ASSERT_EQ(values.size(), 3U); |
| 658 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); | 664 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); |
| 659 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); | 665 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); |
| 660 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); | 666 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); |
| 661 | 667 |
| 662 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); | 668 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); |
| 663 ASSERT_EQ(values.size(), 1U); | 669 ASSERT_EQ(values.size(), 1U); |
| 664 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); | 670 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); |
| 665 } | 671 } |
| OLD | NEW |