| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 void UninitializeSpellCheck() { | 47 void UninitializeSpellCheck() { |
| 48 spell_check_.reset(new SpellCheck()); | 48 spell_check_.reset(new SpellCheck()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void InitializeSpellCheck(const std::string& language) { | 51 void InitializeSpellCheck(const std::string& language) { |
| 52 FilePath hunspell_directory = GetHunspellDirectory(); | 52 FilePath hunspell_directory = GetHunspellDirectory(); |
| 53 EXPECT_FALSE(hunspell_directory.empty()); | 53 EXPECT_FALSE(hunspell_directory.empty()); |
| 54 base::PlatformFile file = base::CreatePlatformFile( | 54 base::PlatformFile file = base::CreatePlatformFile( |
| 55 SpellCheckCommon::GetVersionedFileName(language, hunspell_directory), | 55 chrome::GetVersionedFileName(language, hunspell_directory), |
| 56 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL); | 56 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL); |
| 57 spell_check_->Init( | 57 spell_check_->Init( |
| 58 file, std::vector<std::string>(), language); | 58 file, std::vector<std::string>(), language); |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual ~SpellCheckTest() { | 61 virtual ~SpellCheckTest() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 SpellCheck* spell_check() { return spell_check_.get(); } | 64 SpellCheck* spell_check() { return spell_check_.get(); } |
| 65 | 65 |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 spell_check()->CreateTextCheckingResults( | 1013 spell_check()->CreateTextCheckingResults( |
| 1014 0, text, spellcheck_results, &textcheck_results); | 1014 0, text, spellcheck_results, &textcheck_results); |
| 1015 EXPECT_EQ(spellcheck_results.size(), textcheck_results.size()); | 1015 EXPECT_EQ(spellcheck_results.size(), textcheck_results.size()); |
| 1016 EXPECT_EQ(WebKit::WebTextCheckingTypeGrammar, textcheck_results[0].type); | 1016 EXPECT_EQ(WebKit::WebTextCheckingTypeGrammar, textcheck_results[0].type); |
| 1017 EXPECT_EQ(spellcheck_results[0].location, textcheck_results[0].location); | 1017 EXPECT_EQ(spellcheck_results[0].location, textcheck_results[0].location); |
| 1018 EXPECT_EQ(spellcheck_results[0].length, textcheck_results[0].length); | 1018 EXPECT_EQ(spellcheck_results[0].length, textcheck_results[0].length); |
| 1019 } | 1019 } |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 #endif | 1022 #endif |
| OLD | NEW |