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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 "hi-IN", L"0123456789" L"\x0905", true, | 200 "hi-IN", L"0123456789" L"\x0905", true, |
201 }, { | 201 }, { |
202 // Thai | 202 // Thai |
203 "th-TH", L"0123456789" L"\x0e01", true, | 203 "th-TH", L"0123456789" L"\x0e01", true, |
204 }, { | 204 }, { |
205 // Korean | 205 // Korean |
206 "ko-KR", L"0123456789" L"\x1100\x1161", true, | 206 "ko-KR", L"0123456789" L"\x1100\x1161", true, |
207 }, | 207 }, |
208 }; | 208 }; |
209 | 209 |
210 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { | 210 for (size_t i = 0; i < arraysize(kTestCases); ++i) { |
211 SCOPED_TRACE(base::StringPrintf("kTestCases[%" PRIuS "]: language=%s", i, | 211 SCOPED_TRACE(base::StringPrintf("kTestCases[%" PRIuS "]: language=%s", i, |
212 kTestCases[i].language)); | 212 kTestCases[i].language)); |
213 | 213 |
214 SpellcheckCharAttribute attributes; | 214 SpellcheckCharAttribute attributes; |
215 attributes.SetDefaultLanguage(kTestCases[i].language); | 215 attributes.SetDefaultLanguage(kTestCases[i].language); |
216 | 216 |
217 base::string16 input_word(base::WideToUTF16(kTestCases[i].text)); | 217 base::string16 input_word(base::WideToUTF16(kTestCases[i].text)); |
218 SpellcheckWordIterator iterator; | 218 SpellcheckWordIterator iterator; |
219 EXPECT_TRUE(iterator.Initialize(&attributes, true)); | 219 EXPECT_TRUE(iterator.Initialize(&attributes, true)); |
220 EXPECT_TRUE(iterator.SetText(input_word.c_str(), input_word.length())); | 220 EXPECT_TRUE(iterator.SetText(input_word.c_str(), input_word.length())); |
(...skipping 19 matching lines...) Expand all Loading... |
240 } | 240 } |
241 | 241 |
242 // Test initialization fails when no default language is set. | 242 // Test initialization fails when no default language is set. |
243 { | 243 { |
244 SpellcheckCharAttribute attributes; | 244 SpellcheckCharAttribute attributes; |
245 | 245 |
246 SpellcheckWordIterator iterator; | 246 SpellcheckWordIterator iterator; |
247 EXPECT_FALSE(iterator.Initialize(&attributes, true)); | 247 EXPECT_FALSE(iterator.Initialize(&attributes, true)); |
248 } | 248 } |
249 } | 249 } |
OLD | NEW |