| 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.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/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/browser/autofill_profile.h" | 9 #include "components/autofill/browser/autofill_profile.h" |
| 10 #include "components/autofill/browser/webdata/autofill_change.h" | 10 #include "components/autofill/browser/webdata/autofill_change.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 public: | 102 public: |
| 103 AutofillProfileSyncableServiceTest() | 103 AutofillProfileSyncableServiceTest() |
| 104 : ui_thread_(BrowserThread::UI, &message_loop_), | 104 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 105 db_thread_(BrowserThread::DB, &message_loop_) {} | 105 db_thread_(BrowserThread::DB, &message_loop_) {} |
| 106 | 106 |
| 107 virtual void SetUp() OVERRIDE { | 107 virtual void SetUp() OVERRIDE { |
| 108 sync_processor_.reset(new MockSyncChangeProcessor); | 108 sync_processor_.reset(new MockSyncChangeProcessor); |
| 109 } | 109 } |
| 110 | 110 |
| 111 protected: | 111 protected: |
| 112 MessageLoop message_loop_; | 112 base::MessageLoop message_loop_; |
| 113 content::TestBrowserThread ui_thread_; | 113 content::TestBrowserThread ui_thread_; |
| 114 content::TestBrowserThread db_thread_; | 114 content::TestBrowserThread db_thread_; |
| 115 MockAutofillProfileSyncableService autofill_syncable_service_; | 115 MockAutofillProfileSyncableService autofill_syncable_service_; |
| 116 scoped_ptr<MockSyncChangeProcessor> sync_processor_; | 116 scoped_ptr<MockSyncChangeProcessor> sync_processor_; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 TEST_F(AutofillProfileSyncableServiceTest, MergeDataAndStartSyncing) { | 119 TEST_F(AutofillProfileSyncableServiceTest, MergeDataAndStartSyncing) { |
| 120 std::vector<AutofillProfile *> profiles_from_web_db; | 120 std::vector<AutofillProfile *> profiles_from_web_db; |
| 121 std::string guid_present1 = kGuid1; | 121 std::string guid_present1 = kGuid1; |
| 122 std::string guid_present2 = kGuid2; | 122 std::string guid_present2 = kGuid2; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 profile1.GetRawMultiInfo(autofill::EMAIL_ADDRESS, &values); | 421 profile1.GetRawMultiInfo(autofill::EMAIL_ADDRESS, &values); |
| 422 ASSERT_EQ(values.size(), 3U); | 422 ASSERT_EQ(values.size(), 3U); |
| 423 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); | 423 EXPECT_EQ(values[0], UTF8ToUTF16("1@1.com")); |
| 424 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); | 424 EXPECT_EQ(values[1], UTF8ToUTF16("2@1.com")); |
| 425 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); | 425 EXPECT_EQ(values[2], UTF8ToUTF16("3@1.com")); |
| 426 | 426 |
| 427 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); | 427 profile1.GetRawMultiInfo(autofill::PHONE_HOME_WHOLE_NUMBER, &values); |
| 428 ASSERT_EQ(values.size(), 1U); | 428 ASSERT_EQ(values.size(), 1U); |
| 429 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); | 429 EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); |
| 430 } | 430 } |
| OLD | NEW |