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 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) |
| 103 const OVERRIDE { return syncer::SyncDataList(); } |
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 OVERRIDE { |
| 120 return syncer::SyncDataList(); |
| 121 } |
| 122 |
116 const syncer::SyncChangeList& changes() { return changes_; } | 123 const syncer::SyncChangeList& changes() { return changes_; } |
117 | 124 |
118 private: | 125 private: |
119 syncer::SyncChangeList changes_; | 126 syncer::SyncChangeList changes_; |
120 }; | 127 }; |
121 | 128 |
122 class AutofillProfileSyncableServiceTest : public testing::Test { | 129 class AutofillProfileSyncableServiceTest : public testing::Test { |
123 public: | 130 public: |
124 AutofillProfileSyncableServiceTest() | 131 AutofillProfileSyncableServiceTest() |
125 : ui_thread_(BrowserThread::UI, &message_loop_), | 132 : 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); | 663 profile1.GetRawMultiInfo(autofill::EMAIL_ADDRESS, &values); |
657 ASSERT_EQ(values.size(), 3U); | 664 ASSERT_EQ(values.size(), 3U); |
658 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); | 665 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); |
659 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); | 666 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); |
660 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); | 667 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); |
661 | 668 |
662 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); | 669 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); |
663 ASSERT_EQ(values.size(), 1U); | 670 ASSERT_EQ(values.size(), 1U); |
664 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); | 671 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); |
665 } | 672 } |
OLD | NEW |