Chromium Code Reviews| Index: chrome/renderer/spellchecker/spellcheck_unittest.cc |
| diff --git a/chrome/renderer/spellchecker/spellcheck_unittest.cc b/chrome/renderer/spellchecker/spellcheck_unittest.cc |
| index e581a0c644b44a670030058e4f236a082ec04f09..ae5d6aa48936785dcd4915a3adef31d3eac37106 100644 |
| --- a/chrome/renderer/spellchecker/spellcheck_unittest.cc |
| +++ b/chrome/renderer/spellchecker/spellcheck_unittest.cc |
| @@ -18,6 +18,7 @@ |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingCompletion.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult.h" |
| +#include "ui/base/l10n/l10n_util.h" |
| namespace { |
| @@ -747,6 +748,31 @@ TEST_F(SpellCheckTest, SpellCheckText) { |
| L"c\x00E1\x0063 th\x00F4ng tin c\x1EE7\x0061 " |
| L"th\x1EBF gi\x1EDBi va l\x00E0m cho n\x00F3 universal c\x00F3 " |
| L"th\x1EC3 truy c\x1EADp va h\x1EEFu d\x1EE5ng h\x01A1n." |
| + }, { |
| + // Korean |
| + "ko", |
| + L"Google\xC758 \xBAA9\xD45C\xB294 \xC804\xC138\xACC4\xC758 " |
| + L"\xC815\xBCF4\xB97C \xCCB4\xACC4\xD654\xD558\xC5EC \xBAA8\xB450\xAC00 " |
| + L"\xD3B8\xB9AC\xD558\xAC8C \xC774\xC6A9\xD560 \xC218 " |
| + L"\xC788\xB3C4\xB85D \xD558\xB294 \xAC83\xC785\xB2C8\xB2E4." |
| + }, { |
| + // Albanian |
| + "sq", |
| + L"Misioni i Google \x00EBsht\x00EB q\x00EB t\x00EB organizoj\x00EB " |
| + L"informacionin e bot\x00EBs dhe t\x00EB b\x00EBjn\x00EB at\x00EB " |
| + L"universalisht t\x00EB arritshme dhe t\x00EB dobishme." |
| + }, { |
| + // Tamil |
| + "ta", |
| + L"Google \x0B87\x0BA9\x0BCD " |
| + L"\x0BA8\x0BC7\x0BBE\x0B95\x0BCD\x0B95\x0BAE\x0BCD " |
| + L"\x0B89\x0BB2\x0B95\x0BBF\x0BA9\x0BCD \x0BA4\x0B95\x0BB5\x0BB2\x0BCD " |
| + L"\x0B8F\x0BB1\x0BCD\x0BAA\x0BBE\x0B9F\x0BC1 \x0B87\x0BA4\x0BC1 " |
| + L"\u0B89\u0BB2\u0B95\u0BB3\u0BBE\u0BB5\u0BBF\u0BAF " |
| + L"\x0B85\x0BA3\x0BC1\x0B95\x0B95\x0BCD \x0B95\x0BC2\x0B9F\x0BBF\x0BAF " |
| + L"\x0BAE\x0BB1\x0BCD\x0BB1\x0BC1\x0BAE\x0BCD " |
| + L"\x0BAA\x0BAF\x0BA9\x0BC1\x0BB3\x0BCD\x0BB3 " |
| + L"\x0B9A\x0BC6\x0BAF\x0BCD\x0BAF \x0B89\x0BB3\x0BCD\x0BB3\x0BA4\x0BC1." |
| }, |
| }; |
| @@ -765,7 +791,13 @@ TEST_F(SpellCheckTest, SpellCheckText) { |
| &misspelling_start, |
| &misspelling_length, NULL); |
| - EXPECT_TRUE(result) << kTestCases[i].language; |
| + EXPECT_TRUE(result) |
| + << "\"" |
| + << std::wstring(kTestCases[i].input).substr( |
| + misspelling_start, misspelling_length) |
| + << "\" is misspelled in " |
| + << kTestCases[i].language |
| + << "."; |
| EXPECT_EQ(0, misspelling_start); |
| EXPECT_EQ(0, misspelling_length); |
| } |
| @@ -1214,4 +1246,24 @@ TEST_F(SpellCheckTest, NoSuggest) { |
| } |
| } |
| +// Check that the correct dictionary files are checked in. |
| +TEST_F(SpellCheckTest, DictionaryFiles) { |
| + std::vector<std::string> locale_codes; |
| + l10n_util::GetAcceptLanguagesForLocale("C", &locale_codes); |
| + EXPECT_FALSE(locale_codes.empty()); |
| + |
| + std::vector<std::string> spellcheck_languages; |
| + chrome::spellcheck_common::SpellCheckLanguages(&spellcheck_languages); |
| + EXPECT_FALSE(spellcheck_languages.empty()); |
| + EXPECT_LE(spellcheck_languages.size(), locale_codes.size()); |
| + |
| + FilePath hunspell = GetHunspellDirectory(); |
| + for (size_t i = 0; i < spellcheck_languages.size(); ++i) { |
| + FilePath dict = chrome::spellcheck_common::GetVersionedFileName( |
| + spellcheck_languages[i], hunspell); |
| + EXPECT_TRUE(file_util::PathExists(dict)) << dict.value() << " not found"; |
| + ReinitializeSpellCheck(spellcheck_languages[i]); |
|
rpetterson
2012/12/15 03:53:47
The only error this function will output (from wha
please use gerrit instead
2012/12/15 04:19:14
Removed.
|
| + } |
| +} |
| + |
| #endif |