OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/spellchecker_platform_engine.h" | 7 #include "chrome/browser/spellchecker_platform_engine.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 | 9 |
9 // Tests that words are properly ignored. Currently only enabled on OS X as it | 10 // Tests that words are properly ignored. Currently only enabled on OS X as it |
10 // is the only platform to support ignoring words. Note that in this test, we | 11 // is the only platform to support ignoring words. Note that in this test, we |
11 // supply a non-zero doc_tag, in order to test that ignored words are matched to | 12 // supply a non-zero doc_tag, in order to test that ignored words are matched to |
12 // the correct document. | 13 // the correct document. |
13 TEST(PlatformSpellCheckTest, IgnoreWords_EN_US) { | 14 TEST(PlatformSpellCheckTest, IgnoreWords_EN_US) { |
14 const char* kTestCases[] = { | 15 const char* kTestCases[] = { |
15 "teh", | 16 "teh", |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 const string16 suggested_word(ASCIIToUTF16(kTestCases[i].suggested_word)); | 325 const string16 suggested_word(ASCIIToUTF16(kTestCases[i].suggested_word)); |
325 for (size_t j = 0; j < suggestions.size(); j++) { | 326 for (size_t j = 0; j < suggestions.size(); j++) { |
326 if (suggestions[j].compare(suggested_word) == 0) { | 327 if (suggestions[j].compare(suggested_word) == 0) { |
327 suggested_word_is_present = true; | 328 suggested_word_is_present = true; |
328 break; | 329 break; |
329 } | 330 } |
330 } | 331 } |
331 EXPECT_TRUE(suggested_word_is_present) << suggested_word; | 332 EXPECT_TRUE(suggested_word_is_present) << suggested_word; |
332 } | 333 } |
333 } | 334 } |
OLD | NEW |