| 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 "chrome/renderer/spellchecker/spellcheck.h" | 5 #include "chrome/renderer/spellchecker/spellcheck.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 static const struct { | 498 static const struct { |
| 499 const char* language; | 499 const char* language; |
| 500 const wchar_t* input; | 500 const wchar_t* input; |
| 501 } kTestCases[] = { | 501 } kTestCases[] = { |
| 502 { | 502 { |
| 503 // Afrikaans | 503 // Afrikaans |
| 504 "af-ZA", | 504 "af-ZA", |
| 505 L"Google se missie is om die w\x00EAreld se inligting te organiseer en " | 505 L"Google se missie is om die w\x00EAreld se inligting te organiseer en " |
| 506 L"dit bruikbaar en toeganklik te maak." | 506 L"dit bruikbaar en toeganklik te maak." |
| 507 }, { | 507 }, { |
| 508 // Bulgarian |
| 509 "bg-BG", |
| 510 L"\x041c\x0438\x0441\x0438\x044f\x0442\x0430 " |
| 511 L"\x043d\x0430 Google \x0435 \x0434\x0430 \x043e" |
| 512 L"\x0440\x0433\x0430\x043d\x0438\x0437\x0438\x0440" |
| 513 L"\x0430 \x0441\x0432\x0435\x0442\x043e\x0432" |
| 514 L"\x043d\x0430\x0442\x0430 \x0438\x043d\x0444" |
| 515 L"\x043e\x0440\x043c\x0430\x0446\x0438\x044f " |
| 516 L"\x0438 \x0434\x0430 \x044f \x043d" |
| 517 L"\x0430\x043f\x0440\x0430\x0432\x0438 \x0443" |
| 518 L"\x043d\x0438\x0432\x0435\x0440\x0441\x0430\x043b" |
| 519 L"\x043d\x043e \x0434\x043e\x0441\x0442\x044a" |
| 520 L"\x043f\x043d\x0430 \x0438 \x043f\x043e" |
| 521 L"\x043b\x0435\x0437\x043d\x0430." |
| 522 }, { |
| 508 // Catalan | 523 // Catalan |
| 509 "ca-ES", | 524 "ca-ES", |
| 510 L"La missi\x00F3 de Google \x00E9s organitzar la informaci\x00F3 " | 525 L"La missi\x00F3 de Google \x00E9s organitzar la informaci\x00F3 " |
| 511 L"del m\x00F3n i fer que sigui \x00FAtil i accessible universalment." | 526 L"del m\x00F3n i fer que sigui \x00FAtil i accessible universalment." |
| 512 }, { | 527 }, { |
| 513 // Czech | 528 // Czech |
| 514 "cs-CZ", | 529 "cs-CZ", |
| 515 L"Posl\x00E1n\x00EDm spole\x010Dnosti Google je " | 530 L"Posl\x00E1n\x00EDm spole\x010Dnosti Google je " |
| 516 L"uspo\x0159\x00E1\x0064\x0061t informace z cel\x00E9ho sv\x011Bta " | 531 L"uspo\x0159\x00E1\x0064\x0061t informace z cel\x00E9ho sv\x011Bta " |
| 517 L"tak, aby byly v\x0161\x0065obecn\x011B p\x0159\x00EDstupn\x00E9 " | 532 L"tak, aby byly v\x0161\x0065obecn\x011B p\x0159\x00EDstupn\x00E9 " |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 // English (United Kingdom) | 570 // English (United Kingdom) |
| 556 "en-GB", | 571 "en-GB", |
| 557 L"Google's mission is to organise the world's information and make it " | 572 L"Google's mission is to organise the world's information and make it " |
| 558 L"universally accessible and useful." | 573 L"universally accessible and useful." |
| 559 }, { | 574 }, { |
| 560 // English (United States) | 575 // English (United States) |
| 561 "en-US", | 576 "en-US", |
| 562 L"Google's mission is to organize the world's information and make it " | 577 L"Google's mission is to organize the world's information and make it " |
| 563 L"universally accessible and useful." | 578 L"universally accessible and useful." |
| 564 }, { | 579 }, { |
| 565 // Bulgarian | |
| 566 "bg-BG", | |
| 567 L"\x041c\x0438\x0441\x0438\x044f\x0442\x0430 " | |
| 568 L"\x043d\x0430 Google \x0435 \x0434\x0430 \x043e" | |
| 569 L"\x0440\x0433\x0430\x043d\x0438\x0437\x0438\x0440" | |
| 570 L"\x0430 \x0441\x0432\x0435\x0442\x043e\x0432" | |
| 571 L"\x043d\x0430\x0442\x0430 \x0438\x043d\x0444" | |
| 572 L"\x043e\x0440\x043c\x0430\x0446\x0438\x044f " | |
| 573 L"\x0438 \x0434\x0430 \x044f \x043d" | |
| 574 L"\x0430\x043f\x0440\x0430\x0432\x0438 \x0443" | |
| 575 L"\x043d\x0438\x0432\x0435\x0440\x0441\x0430\x043b" | |
| 576 L"\x043d\x043e \x0434\x043e\x0441\x0442\x044a" | |
| 577 L"\x043f\x043d\x0430 \x0438 \x043f\x043e" | |
| 578 L"\x043b\x0435\x0437\x043d\x0430." | |
| 579 }, { | |
| 580 // Spanish | 580 // Spanish |
| 581 "es-ES", | 581 "es-ES", |
| 582 L"La misi\x00F3n de " | 582 L"La misi\x00F3n de " |
| 583 // L"Google" - to be added. | 583 // L"Google" - to be added. |
| 584 L" es organizar la informaci\x00F3n mundial " | 584 L" es organizar la informaci\x00F3n mundial " |
| 585 L"para que resulte universalmente accesible y \x00FAtil." | 585 L"para que resulte universalmente accesible y \x00FAtil." |
| 586 }, { | 586 }, { |
| 587 // Estonian | 587 // Estonian |
| 588 "et-EE", | 588 "et-EE", |
| 589 // L"Google'ile " - to be added. | 589 // L"Google'ile " - to be added. |
| 590 L"\x00FClesanne on korraldada maailma teavet ja teeb selle " | 590 L"\x00FClesanne on korraldada maailma teavet ja teeb selle " |
| 591 L"k\x00F5igile k\x00E4ttesaadavaks ja kasulikuks.", | 591 L"k\x00F5igile k\x00E4ttesaadavaks ja kasulikuks.", |
| 592 }, { | 592 }, { |
| 593 // Persian |
| 594 "fa", |
| 595 L"\x0686\x0647 \x0637\x0648\x0631 \x0622\x06cc\x0627 \x0634\x0645\x0627 " |
| 596 L"\x0627\x06cc\x0631\x0627\x0646\x06cc \x0647\x0633\x062a\x06cc\x062f" |
| 597 }, { |
| 593 // Faroese | 598 // Faroese |
| 594 "fo-FO", | 599 "fo-FO", |
| 595 L"Google er at samskipa alla vitan \x00ED heiminum og gera hana alment " | 600 L"Google er at samskipa alla vitan \x00ED heiminum og gera hana alment " |
| 596 L"atkomiliga og n\x00FDtiliga." | 601 L"atkomiliga og n\x00FDtiliga." |
| 597 }, { | 602 }, { |
| 598 // French | 603 // French |
| 599 "fr-FR", | 604 "fr-FR", |
| 600 L"Google a pour mission d'organiser les informations \x00E0 " | 605 L"Google a pour mission d'organiser les informations \x00E0 " |
| 601 L"l'\x00E9\x0063helle mondiale dans le but de les rendre accessibles " | 606 L"l'\x00E9\x0063helle mondiale dans le but de les rendre accessibles " |
| 602 L"et utiles \x00E0 tous." | 607 L"et utiles \x00E0 tous." |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 } kTestCases[] = { | 873 } kTestCases[] = { |
| 869 { | 874 { |
| 870 // A misspelled word for English | 875 // A misspelled word for English |
| 871 "en-US", | 876 "en-US", |
| 872 L"aaaaaaaaaa", | 877 L"aaaaaaaaaa", |
| 873 }, { | 878 }, { |
| 874 // A misspelled word for Greek. | 879 // A misspelled word for Greek. |
| 875 "el-GR", | 880 "el-GR", |
| 876 L"\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1", | 881 L"\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1\x03B1", |
| 877 }, { | 882 }, { |
| 883 // A misspelled word for Persian. |
| 884 "fa", |
| 885 L"\x06cc\x06a9\x06cc\x0634\x0627\x0646", |
| 886 }, { |
| 878 // A misspelled word for Hebrew | 887 // A misspelled word for Hebrew |
| 879 "he-IL", | 888 "he-IL", |
| 880 L"\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0", | 889 L"\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0\x05D0", |
| 881 }, { | 890 }, { |
| 882 // Hindi | 891 // Hindi |
| 883 "hi-IN", | 892 "hi-IN", |
| 884 L"\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905", | 893 L"\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905\x0905", |
| 885 }, { | 894 }, { |
| 886 // A misspelled word for Russian | 895 // A misspelled word for Russian |
| 887 "ru-RU", | 896 "ru-RU", |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 // to be updated accordingly. | 1559 // to be updated accordingly. |
| 1551 ASSERT_EQ(5, chrome::spellcheck_common::kMaxSuggestions); | 1560 ASSERT_EQ(5, chrome::spellcheck_common::kMaxSuggestions); |
| 1552 FillSuggestions(suggestions_list, &suggestion_results); | 1561 FillSuggestions(suggestions_list, &suggestion_results); |
| 1553 ASSERT_EQ(5U, suggestion_results.size()); | 1562 ASSERT_EQ(5U, suggestion_results.size()); |
| 1554 EXPECT_EQ(base::ASCIIToUTF16("0foo"), suggestion_results[0]); | 1563 EXPECT_EQ(base::ASCIIToUTF16("0foo"), suggestion_results[0]); |
| 1555 EXPECT_EQ(base::ASCIIToUTF16("1foo"), suggestion_results[1]); | 1564 EXPECT_EQ(base::ASCIIToUTF16("1foo"), suggestion_results[1]); |
| 1556 EXPECT_EQ(base::ASCIIToUTF16("2foo"), suggestion_results[2]); | 1565 EXPECT_EQ(base::ASCIIToUTF16("2foo"), suggestion_results[2]); |
| 1557 EXPECT_EQ(base::ASCIIToUTF16("0bar"), suggestion_results[3]); | 1566 EXPECT_EQ(base::ASCIIToUTF16("0bar"), suggestion_results[3]); |
| 1558 EXPECT_EQ(base::ASCIIToUTF16("1bar"), suggestion_results[4]); | 1567 EXPECT_EQ(base::ASCIIToUTF16("1bar"), suggestion_results[4]); |
| 1559 } | 1568 } |
| OLD | NEW |