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 <map> | 5 #include <map> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 form_structure()->field(0)->Type().GetStorableType()); | 1394 form_structure()->field(0)->Type().GetStorableType()); |
1395 EXPECT_EQ(ADDRESS_HOME, form_structure()->field(0)->Type().group()); | 1395 EXPECT_EQ(ADDRESS_HOME, form_structure()->field(0)->Type().group()); |
1396 EXPECT_EQ(ADDRESS_HOME_STREET_ADDRESS, | 1396 EXPECT_EQ(ADDRESS_HOME_STREET_ADDRESS, |
1397 form_structure()->field(1)->Type().GetStorableType()); | 1397 form_structure()->field(1)->Type().GetStorableType()); |
1398 EXPECT_EQ(ADDRESS_BILLING, form_structure()->field(1)->Type().group()); | 1398 EXPECT_EQ(ADDRESS_BILLING, form_structure()->field(1)->Type().group()); |
1399 // Inexact matching; single-line inputs get the address data concatenated but | 1399 // Inexact matching; single-line inputs get the address data concatenated but |
1400 // separated by commas. | 1400 // separated by commas. |
1401 EXPECT_TRUE(base::StartsWith(form_structure()->field(0)->value, | 1401 EXPECT_TRUE(base::StartsWith(form_structure()->field(0)->value, |
1402 shipping_profile.GetRawInfo(ADDRESS_HOME_LINE1), | 1402 shipping_profile.GetRawInfo(ADDRESS_HOME_LINE1), |
1403 true)); | 1403 true)); |
1404 EXPECT_TRUE(EndsWith(form_structure()->field(0)->value, | 1404 EXPECT_TRUE(base::EndsWith(form_structure()->field(0)->value, |
1405 shipping_profile.GetRawInfo(ADDRESS_HOME_LINE2), | 1405 shipping_profile.GetRawInfo(ADDRESS_HOME_LINE2), |
1406 true)); | 1406 true)); |
1407 EXPECT_TRUE(base::StartsWith(form_structure()->field(1)->value, | 1407 EXPECT_TRUE(base::StartsWith(form_structure()->field(1)->value, |
1408 billing_profile.GetRawInfo(ADDRESS_HOME_LINE1), | 1408 billing_profile.GetRawInfo(ADDRESS_HOME_LINE1), |
1409 true)); | 1409 true)); |
1410 EXPECT_TRUE(EndsWith(form_structure()->field(1)->value, | 1410 EXPECT_TRUE(base::EndsWith(form_structure()->field(1)->value, |
1411 billing_profile.GetRawInfo(ADDRESS_HOME_LINE2), | 1411 billing_profile.GetRawInfo(ADDRESS_HOME_LINE2), |
1412 true)); | 1412 true)); |
1413 // The textareas should be an exact match. | 1413 // The textareas should be an exact match. |
1414 EXPECT_EQ(shipping_profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), | 1414 EXPECT_EQ(shipping_profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), |
1415 form_structure()->field(2)->value); | 1415 form_structure()->field(2)->value); |
1416 EXPECT_EQ(billing_profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), | 1416 EXPECT_EQ(billing_profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), |
1417 form_structure()->field(3)->value); | 1417 form_structure()->field(3)->value); |
1418 | 1418 |
1419 EXPECT_NE(form_structure()->field(1)->value, | 1419 EXPECT_NE(form_structure()->field(1)->value, |
1420 form_structure()->field(0)->value); | 1420 form_structure()->field(0)->value); |
1421 EXPECT_NE(form_structure()->field(3)->value, | 1421 EXPECT_NE(form_structure()->field(3)->value, |
1422 form_structure()->field(2)->value); | 1422 form_structure()->field(2)->value); |
(...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3613 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); | 3613 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(2)->value); |
3614 EXPECT_EQ(ADDRESS_HOME_COUNTRY, | 3614 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
3615 form_structure()->field(3)->Type().GetStorableType()); | 3615 form_structure()->field(3)->Type().GetStorableType()); |
3616 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); | 3616 EXPECT_EQ(ASCIIToUTF16("US"), form_structure()->field(3)->value); |
3617 EXPECT_EQ(ADDRESS_HOME_COUNTRY, | 3617 EXPECT_EQ(ADDRESS_HOME_COUNTRY, |
3618 form_structure()->field(4)->Type().GetStorableType()); | 3618 form_structure()->field(4)->Type().GetStorableType()); |
3619 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); | 3619 EXPECT_EQ(ASCIIToUTF16("United States"), form_structure()->field(4)->value); |
3620 } | 3620 } |
3621 | 3621 |
3622 } // namespace autofill | 3622 } // namespace autofill |
OLD | NEW |