| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 ASSERT_FALSE(imported_credit_card); | 1015 ASSERT_FALSE(imported_credit_card); |
| 1016 | 1016 |
| 1017 // Verify that the web database has been updated and the notification sent. | 1017 // Verify that the web database has been updated and the notification sent. |
| 1018 EXPECT_CALL(personal_data_observer_, | 1018 EXPECT_CALL(personal_data_observer_, |
| 1019 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 1019 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
| 1020 MessageLoop::current()->Run(); | 1020 MessageLoop::current()->Run(); |
| 1021 | 1021 |
| 1022 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); | 1022 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); |
| 1023 | 1023 |
| 1024 // Modify expected to include multi-valued fields. | 1024 // Modify expected to include multi-valued fields. |
| 1025 std::vector<string16> values; | 1025 std::vector<base::string16> values; |
| 1026 expected.GetRawMultiInfo(NAME_FULL, &values); | 1026 expected.GetRawMultiInfo(NAME_FULL, &values); |
| 1027 values.push_back(ASCIIToUTF16("John Adams")); | 1027 values.push_back(ASCIIToUTF16("John Adams")); |
| 1028 expected.SetRawMultiInfo(NAME_FULL, values); | 1028 expected.SetRawMultiInfo(NAME_FULL, values); |
| 1029 expected.GetRawMultiInfo(EMAIL_ADDRESS, &values); | 1029 expected.GetRawMultiInfo(EMAIL_ADDRESS, &values); |
| 1030 values.push_back(ASCIIToUTF16("second@gmail.com")); | 1030 values.push_back(ASCIIToUTF16("second@gmail.com")); |
| 1031 expected.SetRawMultiInfo(EMAIL_ADDRESS, values); | 1031 expected.SetRawMultiInfo(EMAIL_ADDRESS, values); |
| 1032 | 1032 |
| 1033 ASSERT_EQ(1U, results2.size()); | 1033 ASSERT_EQ(1U, results2.size()); |
| 1034 EXPECT_EQ(0, expected.Compare(*results2[0])); | 1034 EXPECT_EQ(0, expected.Compare(*results2[0])); |
| 1035 } | 1035 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 ASSERT_FALSE(imported_credit_card); | 1128 ASSERT_FALSE(imported_credit_card); |
| 1129 | 1129 |
| 1130 // Verify that the web database has been updated and the notification sent. | 1130 // Verify that the web database has been updated and the notification sent. |
| 1131 EXPECT_CALL(personal_data_observer_, | 1131 EXPECT_CALL(personal_data_observer_, |
| 1132 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 1132 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
| 1133 MessageLoop::current()->Run(); | 1133 MessageLoop::current()->Run(); |
| 1134 | 1134 |
| 1135 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); | 1135 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); |
| 1136 | 1136 |
| 1137 // Add multi-valued phone number to expectation. Also, country gets added. | 1137 // Add multi-valued phone number to expectation. Also, country gets added. |
| 1138 std::vector<string16> values; | 1138 std::vector<base::string16> values; |
| 1139 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); | 1139 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); |
| 1140 values.push_back(ASCIIToUTF16("(650) 223-1234")); | 1140 values.push_back(ASCIIToUTF16("(650) 223-1234")); |
| 1141 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); | 1141 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); |
| 1142 expected.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("US")); | 1142 expected.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("US")); |
| 1143 ASSERT_EQ(1U, results2.size()); | 1143 ASSERT_EQ(1U, results2.size()); |
| 1144 EXPECT_EQ(0, expected.Compare(*results2[0])); | 1144 EXPECT_EQ(0, expected.Compare(*results2[0])); |
| 1145 } | 1145 } |
| 1146 | 1146 |
| 1147 TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) { | 1147 TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) { |
| 1148 FormData form1; | 1148 FormData form1; |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2115 ASSERT_FALSE(imported_credit_card); | 2115 ASSERT_FALSE(imported_credit_card); |
| 2116 | 2116 |
| 2117 // Verify that the web database has been updated and the notification sent. | 2117 // Verify that the web database has been updated and the notification sent. |
| 2118 EXPECT_CALL(personal_data_observer_, | 2118 EXPECT_CALL(personal_data_observer_, |
| 2119 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 2119 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
| 2120 MessageLoop::current()->Run(); | 2120 MessageLoop::current()->Run(); |
| 2121 | 2121 |
| 2122 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); | 2122 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); |
| 2123 | 2123 |
| 2124 // Modify expected to include multi-valued fields. | 2124 // Modify expected to include multi-valued fields. |
| 2125 std::vector<string16> values; | 2125 std::vector<base::string16> values; |
| 2126 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); | 2126 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); |
| 2127 values.push_back(ASCIIToUTF16("(214) 555-1234")); | 2127 values.push_back(ASCIIToUTF16("(214) 555-1234")); |
| 2128 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); | 2128 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); |
| 2129 | 2129 |
| 2130 ASSERT_EQ(1U, results2.size()); | 2130 ASSERT_EQ(1U, results2.size()); |
| 2131 EXPECT_EQ(0, expected.Compare(*results2[0])); | 2131 EXPECT_EQ(0, expected.Compare(*results2[0])); |
| 2132 } | 2132 } |
| OLD | NEW |