OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 "H. R. Giger", | 359 "H. R. Giger", |
360 "H. R. Giger, Brandschenkestrasse 110", | 360 "H. R. Giger, Brandschenkestrasse 110", |
361 "H. R. Giger, Brandschenkestrasse 110, Zurich", | 361 "H. R. Giger, Brandschenkestrasse 110, Zurich", |
362 "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", | 362 "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", |
363 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", | 363 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", |
364 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " | 364 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " |
365 "Switzerland", | 365 "Switzerland", |
366 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " | 366 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " |
367 "Switzerland, hrgiger@beispiel.com", | 367 "Switzerland, hrgiger@beispiel.com", |
368 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " | 368 "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " |
369 "Switzerland, hrgiger@beispiel.com, +41446681800", | 369 "Switzerland, hrgiger@beispiel.com, +41 44-668-1800", |
370 }; | 370 }; |
371 | 371 |
372 std::vector<base::string16> labels; | 372 std::vector<base::string16> labels; |
373 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { | 373 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { |
374 AutofillProfile::CreateInferredLabels( | 374 AutofillProfile::CreateInferredLabels( |
375 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); | 375 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); |
376 ASSERT_FALSE(labels.empty()); | 376 ASSERT_FALSE(labels.empty()); |
377 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); | 377 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); |
378 } | 378 } |
379 } | 379 } |
(...skipping 25 matching lines...) Expand all Loading... |
405 "Antoine de Saint-Exupéry, 8 Rue de Londres, Paris", | 405 "Antoine de Saint-Exupéry, 8 Rue de Londres, Paris", |
406 "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris", | 406 "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris", |
407 "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX", | 407 "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX", |
408 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " | 408 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " |
409 "CEDEX", | 409 "CEDEX", |
410 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " | 410 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " |
411 "CEDEX, France", | 411 "CEDEX, France", |
412 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " | 412 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " |
413 "CEDEX, France, antoine@exemple.com", | 413 "CEDEX, France, antoine@exemple.com", |
414 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " | 414 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " |
415 "CEDEX, France, antoine@exemple.com, +33142685300", | 415 "CEDEX, France, antoine@exemple.com, +33 (0) 1 42 68 53 00", |
416 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " | 416 "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " |
417 "CEDEX, France, antoine@exemple.com, +33142685300", | 417 "CEDEX, France, antoine@exemple.com, +33 (0) 1 42 68 53 00", |
418 }; | 418 }; |
419 | 419 |
420 std::vector<base::string16> labels; | 420 std::vector<base::string16> labels; |
421 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { | 421 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { |
422 AutofillProfile::CreateInferredLabels( | 422 AutofillProfile::CreateInferredLabels( |
423 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); | 423 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); |
424 ASSERT_FALSE(labels.empty()); | 424 ASSERT_FALSE(labels.empty()); |
425 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); | 425 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); |
426 } | 426 } |
427 } | 427 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 "Gangnam-Gu, Seoul, 135-984", | 460 "Gangnam-Gu, Seoul, 135-984", |
461 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " | 461 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " |
462 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984", | 462 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984", |
463 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " | 463 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " |
464 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea", | 464 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea", |
465 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " | 465 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " |
466 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " | 466 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " |
467 "park@yeleul.com", | 467 "park@yeleul.com", |
468 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " | 468 "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " |
469 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " | 469 "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " |
470 "park@yeleul.com, +8225319000", | 470 "park@yeleul.com, +82-2-531-9000", |
471 }; | 471 }; |
472 | 472 |
473 std::vector<base::string16> labels; | 473 std::vector<base::string16> labels; |
474 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { | 474 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { |
475 AutofillProfile::CreateInferredLabels( | 475 AutofillProfile::CreateInferredLabels( |
476 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); | 476 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); |
477 ASSERT_FALSE(labels.empty()); | 477 ASSERT_FALSE(labels.empty()); |
478 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); | 478 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); |
479 } | 479 } |
480 } | 480 } |
(...skipping 25 matching lines...) Expand all Loading... |
506 "Tokyo", | 506 "Tokyo", |
507 "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " | 507 "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " |
508 "Tokyo, 106-6126", | 508 "Tokyo, 106-6126", |
509 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " | 509 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " |
510 "Minato-ku, Tokyo, 106-6126", | 510 "Minato-ku, Tokyo, 106-6126", |
511 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " | 511 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " |
512 "Minato-ku, Tokyo, 106-6126, Japan", | 512 "Minato-ku, Tokyo, 106-6126, Japan", |
513 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " | 513 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " |
514 "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com", | 514 "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com", |
515 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " | 515 "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " |
516 "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com, +81363849000", | 516 "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com, +81-3-6384-9000", |
517 }; | 517 }; |
518 | 518 |
519 std::vector<base::string16> labels; | 519 std::vector<base::string16> labels; |
520 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { | 520 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { |
521 AutofillProfile::CreateInferredLabels( | 521 AutofillProfile::CreateInferredLabels( |
522 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); | 522 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); |
523 ASSERT_FALSE(labels.empty()); | 523 ASSERT_FALSE(labels.empty()); |
524 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); | 524 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); |
525 } | 525 } |
526 } | 526 } |
(...skipping 21 matching lines...) Expand all Loading... |
548 "六本木ヒルズ森タワーミク 初音", | 548 "六本木ヒルズ森タワーミク 初音", |
549 "六本木ヒルズ森タワー六本木 6-10-1ミク 初音", | 549 "六本木ヒルズ森タワー六本木 6-10-1ミク 初音", |
550 "港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", | 550 "港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", |
551 "東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", | 551 "東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", |
552 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", | 552 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", |
553 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音", | 553 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音", |
554 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan", | 554 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan", |
555 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " | 555 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " |
556 "miku@rei.com", | 556 "miku@rei.com", |
557 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " | 557 "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " |
558 "miku@rei.com, 0363849000", | 558 "miku@rei.com, 03-6384-9000", |
559 }; | 559 }; |
560 | 560 |
561 std::vector<base::string16> labels; | 561 std::vector<base::string16> labels; |
562 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { | 562 for (size_t i = 0; i < arraysize(kExpectedLabels); ++i) { |
563 AutofillProfile::CreateInferredLabels( | 563 AutofillProfile::CreateInferredLabels( |
564 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); | 564 profiles.get(), NULL, UNKNOWN_TYPE, i, "en-US", &labels); |
565 ASSERT_FALSE(labels.empty()); | 565 ASSERT_FALSE(labels.empty()); |
566 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); | 566 EXPECT_EQ(UTF8ToUTF16(kExpectedLabels[i]), labels.back()); |
567 } | 567 } |
568 } | 568 } |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 AutofillProfile::CanonicalizeProfileString(base::WideToUTF16( | 1108 AutofillProfile::CanonicalizeProfileString(base::WideToUTF16( |
1109 L"Mid\x2013Island\x2003 Plaza"))); | 1109 L"Mid\x2013Island\x2003 Plaza"))); |
1110 | 1110 |
1111 // Newline character removed. | 1111 // Newline character removed. |
1112 EXPECT_EQ(ASCIIToUTF16("1600 amphitheatre pkwy app 2"), | 1112 EXPECT_EQ(ASCIIToUTF16("1600 amphitheatre pkwy app 2"), |
1113 AutofillProfile::CanonicalizeProfileString( | 1113 AutofillProfile::CanonicalizeProfileString( |
1114 ASCIIToUTF16("1600 amphitheatre pkwy \n App. 2"))); | 1114 ASCIIToUTF16("1600 amphitheatre pkwy \n App. 2"))); |
1115 } | 1115 } |
1116 | 1116 |
1117 } // namespace autofill | 1117 } // namespace autofill |
OLD | NEW |