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 "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 "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 base::PlatformFile file = base::CreatePlatformFile( | 60 base::PlatformFile file = base::CreatePlatformFile( |
61 chrome::spellcheck_common::GetVersionedFileName(language, | 61 chrome::spellcheck_common::GetVersionedFileName(language, |
62 hunspell_directory), | 62 hunspell_directory), |
63 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL); | 63 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL); |
64 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
65 // TODO(groby): Forcing spellcheck to use hunspell, even on OSX. | 65 // TODO(groby): Forcing spellcheck to use hunspell, even on OSX. |
66 // Instead, tests should exercise individual spelling engines. | 66 // Instead, tests should exercise individual spelling engines. |
67 spell_check_->spellcheck_.platform_spelling_engine_.reset( | 67 spell_check_->spellcheck_.platform_spelling_engine_.reset( |
68 new HunspellEngine); | 68 new HunspellEngine); |
69 #endif | 69 #endif |
70 spell_check_->Init( | 70 spell_check_->Init(file, std::set<std::string>(), language); |
71 file, std::vector<std::string>(), language); | |
72 } | 71 } |
73 | 72 |
74 void EnableAutoCorrect(bool enable_autocorrect) { | 73 void EnableAutoCorrect(bool enable_autocorrect) { |
75 spell_check_->OnEnableAutoSpellCorrect(enable_autocorrect); | 74 spell_check_->OnEnableAutoSpellCorrect(enable_autocorrect); |
76 } | 75 } |
77 | 76 |
78 virtual ~SpellCheckTest() { | 77 virtual ~SpellCheckTest() { |
79 } | 78 } |
80 | 79 |
81 SpellCheck* spell_check() { return spell_check_.get(); } | 80 SpellCheck* spell_check() { return spell_check_.get(); } |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 strlen(kTestCases[i].misspelled), | 1353 strlen(kTestCases[i].misspelled), |
1355 0, | 1354 0, |
1356 &misspelling_start, | 1355 &misspelling_start, |
1357 &misspelling_length, | 1356 &misspelling_length, |
1358 &suggestions)); | 1357 &suggestions)); |
1359 EXPECT_GE(suggestions.size(), static_cast<size_t>(1)); | 1358 EXPECT_GE(suggestions.size(), static_cast<size_t>(1)); |
1360 if (suggestions.size() > 0) | 1359 if (suggestions.size() > 0) |
1361 EXPECT_EQ(suggestions[0], ASCIIToUTF16(kTestCases[i].suggestion)); | 1360 EXPECT_EQ(suggestions[0], ASCIIToUTF16(kTestCases[i].suggestion)); |
1362 } | 1361 } |
1363 } | 1362 } |
OLD | NEW |