| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/spellchecker.h" | 10 #include "chrome/browser/spellchecker.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 {L"wellfare", false, 0,0,L"welfare"}, | 600 {L"wellfare", false, 0,0,L"welfare"}, |
| 601 {L"wilfull", false, 0,0,L"willful"}, | 601 {L"wilfull", false, 0,0,L"willful"}, |
| 602 {L"withold", false, 0,0,L"withhold"}, | 602 {L"withold", false, 0,0,L"withhold"}, |
| 603 {L"writting", false, 0,0,L"writing"}, | 603 {L"writting", false, 0,0,L"writing"}, |
| 604 #else | 604 #else |
| 605 {L"ello", false, 0, 0, L"hello"}, | 605 {L"ello", false, 0, 0, L"hello"}, |
| 606 {L"ello", false, 0, 0, L"cello"}, | 606 {L"ello", false, 0, 0, L"cello"}, |
| 607 {L"wate", false, 0, 0, L"water"}, | 607 {L"wate", false, 0, 0, L"water"}, |
| 608 {L"wate", false, 0, 0, L"waste"}, | 608 {L"wate", false, 0, 0, L"waste"}, |
| 609 {L"wate", false, 0, 0, L"sate"}, | 609 {L"wate", false, 0, 0, L"sate"}, |
| 610 {L"wate", false, 0, 0, L"rate"}, | 610 {L"wate", false, 0, 0, L"ate"}, |
| 611 {L"jum", false, 0, 0, L"jump"}, | 611 {L"jum", false, 0, 0, L"jump"}, |
| 612 {L"jum", false, 0, 0, L"rum"}, | 612 {L"jum", false, 0, 0, L"hum"}, |
| 613 {L"jum", false, 0, 0, L"sum"}, | 613 {L"jum", false, 0, 0, L"sum"}, |
| 614 {L"jum", false, 0, 0, L"tum"}, | 614 {L"jum", false, 0, 0, L"um"}, |
| 615 #endif //!OS_MACOSX | 615 #endif //!OS_MACOSX |
| 616 // TODO (Sidchat): add many more examples. | 616 // TODO (Sidchat): add many more examples. |
| 617 }; | 617 }; |
| 618 | 618 |
| 619 FilePath hunspell_directory = GetHunspellDirectory(); | 619 FilePath hunspell_directory = GetHunspellDirectory(); |
| 620 ASSERT_FALSE(hunspell_directory.empty()); | 620 ASSERT_FALSE(hunspell_directory.empty()); |
| 621 | 621 |
| 622 scoped_refptr<SpellChecker> spell_checker(new SpellChecker( | 622 scoped_refptr<SpellChecker> spell_checker(new SpellChecker( |
| 623 hunspell_directory, "en-US", NULL, FilePath())); | 623 hunspell_directory, "en-US", NULL, FilePath())); |
| 624 | 624 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { | 824 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { |
| 825 std::wstring misspelled_word(kTestCases[i].input); | 825 std::wstring misspelled_word(kTestCases[i].input); |
| 826 std::wstring expected_autocorrect_word(kTestCases[i].expected_result); | 826 std::wstring expected_autocorrect_word(kTestCases[i].expected_result); |
| 827 std::wstring autocorrect_word; | 827 std::wstring autocorrect_word; |
| 828 spell_checker->GetAutoCorrectionWord(misspelled_word, &autocorrect_word); | 828 spell_checker->GetAutoCorrectionWord(misspelled_word, &autocorrect_word); |
| 829 | 829 |
| 830 // Check for spelling. | 830 // Check for spelling. |
| 831 EXPECT_EQ(expected_autocorrect_word, autocorrect_word); | 831 EXPECT_EQ(expected_autocorrect_word, autocorrect_word); |
| 832 } | 832 } |
| 833 } | 833 } |
| OLD | NEW |