1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/i18n/break_iterator.h"
9 #include "base/macros.h"
10 #include "base/strings/string_piece.h"
11 #include "base/strings/stringprintf.h"
12 #include "base/strings/utf_string_conversions.h"
13 #include "testing/gtest/include/gtest/gtest.h"
18 TEST(BreakIteratorTest, BreakWordEmpty) {
20 BreakIterator iter(empty, BreakIterator::BREAK_WORD);
21 ASSERT_TRUE(iter.Init());
22 EXPECT_FALSE(iter.Advance());
23 EXPECT_FALSE(iter.IsWord());
24 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
25 EXPECT_FALSE(iter.IsWord());
28 TEST(BreakIteratorTest, BreakWord) {
29 string16 space(UTF8ToUTF16(" "));
30 string16 str(UTF8ToUTF16(" foo bar! \npouet boom"));
31 BreakIterator iter(str, BreakIterator::BREAK_WORD);
32 ASSERT_TRUE(iter.Init());
33 EXPECT_TRUE(iter.Advance());
34 EXPECT_FALSE(iter.IsWord());
35 EXPECT_EQ(space, iter.GetString());
36 EXPECT_TRUE(iter.Advance());
37 EXPECT_TRUE(iter.IsWord());
38 EXPECT_EQ(UTF8ToUTF16("foo"), iter.GetString());
39 EXPECT_TRUE(iter.Advance());
40 EXPECT_FALSE(iter.IsWord());
41 EXPECT_EQ(space, iter.GetString());
42 EXPECT_TRUE(iter.Advance());
43 EXPECT_TRUE(iter.IsWord());
44 EXPECT_EQ(UTF8ToUTF16("bar"), iter.GetString());
45 EXPECT_TRUE(iter.Advance());
46 EXPECT_FALSE(iter.IsWord());
47 EXPECT_EQ(UTF8ToUTF16("!"), iter.GetString());
48 EXPECT_TRUE(iter.Advance());
49 EXPECT_FALSE(iter.IsWord());
50 EXPECT_EQ(space, iter.GetString());
51 EXPECT_TRUE(iter.Advance());
52 EXPECT_FALSE(iter.IsWord());
53 EXPECT_EQ(UTF8ToUTF16("\n"), iter.GetString());
54 EXPECT_TRUE(iter.Advance());
55 EXPECT_TRUE(iter.IsWord());
56 EXPECT_EQ(UTF8ToUTF16("pouet"), iter.GetString());
57 EXPECT_TRUE(iter.Advance());
58 EXPECT_FALSE(iter.IsWord());
59 EXPECT_EQ(space, iter.GetString());
60 EXPECT_TRUE(iter.Advance());
61 EXPECT_TRUE(iter.IsWord());
62 EXPECT_EQ(UTF8ToUTF16("boom"), iter.GetString());
63 EXPECT_FALSE(iter.Advance());
64 EXPECT_FALSE(iter.IsWord());
65 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
66 EXPECT_FALSE(iter.IsWord());
69 TEST(BreakIteratorTest, BreakWide16) {
70 // Two greek words separated by space.
71 const string16 str(WideToUTF16(
72 L"\x03a0\x03b1\x03b3\x03ba\x03cc\x03c3\x03bc\x03b9"
73 L"\x03bf\x03c2\x0020\x0399\x03c3\x03c4\x03cc\x03c2"));
74 const string16 word1(str.substr(0, 10));
75 const string16 word2(str.substr(11, 5));
76 BreakIterator iter(str, BreakIterator::BREAK_WORD);
77 ASSERT_TRUE(iter.Init());
78 EXPECT_TRUE(iter.Advance());
79 EXPECT_TRUE(iter.IsWord());
80 EXPECT_EQ(word1, iter.GetString());
81 EXPECT_TRUE(iter.Advance());
82 EXPECT_FALSE(iter.IsWord());
83 EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
84 EXPECT_TRUE(iter.Advance());
85 EXPECT_TRUE(iter.IsWord());
86 EXPECT_EQ(word2, iter.GetString());
87 EXPECT_FALSE(iter.Advance());
88 EXPECT_FALSE(iter.IsWord());
89 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
90 EXPECT_FALSE(iter.IsWord());
93 TEST(BreakIteratorTest, BreakWide32) {
94 // U+1D49C MATHEMATICAL SCRIPT CAPITAL A
95 const char very_wide_char[] = "\xF0\x9D\x92\x9C";
97 UTF8ToUTF16(base::StringPrintf("%s a", very_wide_char)));
98 const string16 very_wide_word(str.substr(0, 2));
100 BreakIterator iter(str, BreakIterator::BREAK_WORD);
101 ASSERT_TRUE(iter.Init());
102 EXPECT_TRUE(iter.Advance());
103 EXPECT_TRUE(iter.IsWord());
104 EXPECT_EQ(very_wide_word, iter.GetString());
105 EXPECT_TRUE(iter.Advance());
106 EXPECT_FALSE(iter.IsWord());
107 EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
108 EXPECT_TRUE(iter.Advance());
109 EXPECT_TRUE(iter.IsWord());
110 EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
111 EXPECT_FALSE(iter.Advance());
112 EXPECT_FALSE(iter.IsWord());
113 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
114 EXPECT_FALSE(iter.IsWord());
117 TEST(BreakIteratorTest, BreakSpaceEmpty) {
119 BreakIterator iter(empty, BreakIterator::BREAK_SPACE);
120 ASSERT_TRUE(iter.Init());
121 EXPECT_FALSE(iter.Advance());
122 EXPECT_FALSE(iter.IsWord());
123 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
124 EXPECT_FALSE(iter.IsWord());
127 TEST(BreakIteratorTest, BreakSpace) {
128 string16 str(UTF8ToUTF16(" foo bar! \npouet boom"));
129 BreakIterator iter(str, BreakIterator::BREAK_SPACE);
130 ASSERT_TRUE(iter.Init());
131 EXPECT_TRUE(iter.Advance());
132 EXPECT_FALSE(iter.IsWord());
133 EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
134 EXPECT_TRUE(iter.Advance());
135 EXPECT_FALSE(iter.IsWord());
136 EXPECT_EQ(UTF8ToUTF16("foo "), iter.GetString());
137 EXPECT_TRUE(iter.Advance());
138 EXPECT_FALSE(iter.IsWord());
139 EXPECT_EQ(UTF8ToUTF16("bar! \n"), iter.GetString());
140 EXPECT_TRUE(iter.Advance());
141 EXPECT_FALSE(iter.IsWord());
142 EXPECT_EQ(UTF8ToUTF16("pouet "), iter.GetString());
143 EXPECT_TRUE(iter.Advance());
144 EXPECT_FALSE(iter.IsWord());
145 EXPECT_EQ(UTF8ToUTF16("boom"), iter.GetString());
146 EXPECT_FALSE(iter.Advance());
147 EXPECT_FALSE(iter.IsWord());
148 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
149 EXPECT_FALSE(iter.IsWord());
152 TEST(BreakIteratorTest, BreakSpaceSP) {
153 string16 str(UTF8ToUTF16(" foo bar! \npouet boom "));
154 BreakIterator iter(str, BreakIterator::BREAK_SPACE);
155 ASSERT_TRUE(iter.Init());
156 EXPECT_TRUE(iter.Advance());
157 EXPECT_FALSE(iter.IsWord());
158 EXPECT_EQ(UTF8ToUTF16(" "), iter.GetString());
159 EXPECT_TRUE(iter.Advance());
160 EXPECT_FALSE(iter.IsWord());
161 EXPECT_EQ(UTF8ToUTF16("foo "), iter.GetString());
162 EXPECT_TRUE(iter.Advance());
163 EXPECT_FALSE(iter.IsWord());
164 EXPECT_EQ(UTF8ToUTF16("bar! \n"), iter.GetString());
165 EXPECT_TRUE(iter.Advance());
166 EXPECT_FALSE(iter.IsWord());
167 EXPECT_EQ(UTF8ToUTF16("pouet "), iter.GetString());
168 EXPECT_TRUE(iter.Advance());
169 EXPECT_FALSE(iter.IsWord());
170 EXPECT_EQ(UTF8ToUTF16("boom "), iter.GetString());
171 EXPECT_FALSE(iter.Advance());
172 EXPECT_FALSE(iter.IsWord());
173 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
174 EXPECT_FALSE(iter.IsWord());
177 TEST(BreakIteratorTest, BreakSpacekWide16) {
179 const string16 str(WideToUTF16(
180 L"\x03a0\x03b1\x03b3\x03ba\x03cc\x03c3\x03bc\x03b9"
181 L"\x03bf\x03c2\x0020\x0399\x03c3\x03c4\x03cc\x03c2"));
182 const string16 word1(str.substr(0, 11));
183 const string16 word2(str.substr(11, 5));
184 BreakIterator iter(str, BreakIterator::BREAK_SPACE);
185 ASSERT_TRUE(iter.Init());
186 EXPECT_TRUE(iter.Advance());
187 EXPECT_FALSE(iter.IsWord());
188 EXPECT_EQ(word1, iter.GetString());
189 EXPECT_TRUE(iter.Advance());
190 EXPECT_FALSE(iter.IsWord());
191 EXPECT_EQ(word2, iter.GetString());
192 EXPECT_FALSE(iter.Advance());
193 EXPECT_FALSE(iter.IsWord());
194 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
195 EXPECT_FALSE(iter.IsWord());
198 TEST(BreakIteratorTest, BreakSpaceWide32) {
199 // U+1D49C MATHEMATICAL SCRIPT CAPITAL A
200 const char very_wide_char[] = "\xF0\x9D\x92\x9C";
202 UTF8ToUTF16(base::StringPrintf("%s a", very_wide_char)));
203 const string16 very_wide_word(str.substr(0, 3));
205 BreakIterator iter(str, BreakIterator::BREAK_SPACE);
206 ASSERT_TRUE(iter.Init());
207 EXPECT_TRUE(iter.Advance());
208 EXPECT_FALSE(iter.IsWord());
209 EXPECT_EQ(very_wide_word, iter.GetString());
210 EXPECT_TRUE(iter.Advance());
211 EXPECT_FALSE(iter.IsWord());
212 EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
213 EXPECT_FALSE(iter.Advance());
214 EXPECT_FALSE(iter.IsWord());
215 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
216 EXPECT_FALSE(iter.IsWord());
219 TEST(BreakIteratorTest, BreakLineEmpty) {
221 BreakIterator iter(empty, BreakIterator::BREAK_NEWLINE);
222 ASSERT_TRUE(iter.Init());
223 EXPECT_FALSE(iter.Advance());
224 EXPECT_FALSE(iter.IsWord());
225 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
226 EXPECT_FALSE(iter.IsWord());
229 TEST(BreakIteratorTest, BreakLine) {
230 string16 nl(UTF8ToUTF16("\n"));
231 string16 str(UTF8ToUTF16("\nfoo bar!\n\npouet boom"));
232 BreakIterator iter(str, BreakIterator::BREAK_NEWLINE);
233 ASSERT_TRUE(iter.Init());
234 EXPECT_TRUE(iter.Advance());
235 EXPECT_FALSE(iter.IsWord());
236 EXPECT_EQ(nl, iter.GetString());
237 EXPECT_TRUE(iter.Advance());
238 EXPECT_FALSE(iter.IsWord());
239 EXPECT_EQ(UTF8ToUTF16("foo bar!\n"), iter.GetString());
240 EXPECT_TRUE(iter.Advance());
241 EXPECT_FALSE(iter.IsWord());
242 EXPECT_EQ(nl, iter.GetString());
243 EXPECT_TRUE(iter.Advance());
244 EXPECT_FALSE(iter.IsWord());
245 EXPECT_EQ(UTF8ToUTF16("pouet boom"), iter.GetString());
246 EXPECT_FALSE(iter.Advance());
247 EXPECT_FALSE(iter.IsWord());
248 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
249 EXPECT_FALSE(iter.IsWord());
252 TEST(BreakIteratorTest, BreakLineNL) {
253 string16 nl(UTF8ToUTF16("\n"));
254 string16 str(UTF8ToUTF16("\nfoo bar!\n\npouet boom\n"));
255 BreakIterator iter(str, BreakIterator::BREAK_NEWLINE);
256 ASSERT_TRUE(iter.Init());
257 EXPECT_TRUE(iter.Advance());
258 EXPECT_FALSE(iter.IsWord());
259 EXPECT_EQ(nl, iter.GetString());
260 EXPECT_TRUE(iter.Advance());
261 EXPECT_FALSE(iter.IsWord());
262 EXPECT_EQ(UTF8ToUTF16("foo bar!\n"), iter.GetString());
263 EXPECT_TRUE(iter.Advance());
264 EXPECT_FALSE(iter.IsWord());
265 EXPECT_EQ(nl, iter.GetString());
266 EXPECT_TRUE(iter.Advance());
267 EXPECT_FALSE(iter.IsWord());
268 EXPECT_EQ(UTF8ToUTF16("pouet boom\n"), iter.GetString());
269 EXPECT_FALSE(iter.Advance());
270 EXPECT_FALSE(iter.IsWord());
271 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
272 EXPECT_FALSE(iter.IsWord());
275 TEST(BreakIteratorTest, BreakLineWide16) {
276 // Two Greek words separated by newline.
277 const string16 str(WideToUTF16(
278 L"\x03a0\x03b1\x03b3\x03ba\x03cc\x03c3\x03bc\x03b9"
279 L"\x03bf\x03c2\x000a\x0399\x03c3\x03c4\x03cc\x03c2"));
280 const string16 line1(str.substr(0, 11));
281 const string16 line2(str.substr(11, 5));
282 BreakIterator iter(str, BreakIterator::BREAK_NEWLINE);
283 ASSERT_TRUE(iter.Init());
284 EXPECT_TRUE(iter.Advance());
285 EXPECT_FALSE(iter.IsWord());
286 EXPECT_EQ(line1, iter.GetString());
287 EXPECT_TRUE(iter.Advance());
288 EXPECT_FALSE(iter.IsWord());
289 EXPECT_EQ(line2, iter.GetString());
290 EXPECT_FALSE(iter.Advance());
291 EXPECT_FALSE(iter.IsWord());
292 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
293 EXPECT_FALSE(iter.IsWord());
296 TEST(BreakIteratorTest, BreakLineWide32) {
297 // U+1D49C MATHEMATICAL SCRIPT CAPITAL A
298 const char very_wide_char[] = "\xF0\x9D\x92\x9C";
300 UTF8ToUTF16(base::StringPrintf("%s\na", very_wide_char)));
301 const string16 very_wide_line(str.substr(0, 3));
302 BreakIterator iter(str, BreakIterator::BREAK_NEWLINE);
303 ASSERT_TRUE(iter.Init());
304 EXPECT_TRUE(iter.Advance());
305 EXPECT_FALSE(iter.IsWord());
306 EXPECT_EQ(very_wide_line, iter.GetString());
307 EXPECT_TRUE(iter.Advance());
308 EXPECT_FALSE(iter.IsWord());
309 EXPECT_EQ(UTF8ToUTF16("a"), iter.GetString());
310 EXPECT_FALSE(iter.Advance());
311 EXPECT_FALSE(iter.IsWord());
312 EXPECT_FALSE(iter.Advance()); // Test unexpected advance after end.
313 EXPECT_FALSE(iter.IsWord());
316 TEST(BreakIteratorTest, BreakCharacter) {
317 static const wchar_t* kCharacters[] = {
318 // An English word consisting of four ASCII characters.
319 L"w", L"o", L"r", L"d", L" ",
320 // A Hindi word (which means "Hindi") consisting of three Devanagari
322 L"\x0939\x093F", L"\x0928\x094D", L"\x0926\x0940", L" ",
323 // A Thai word (which means "feel") consisting of three Thai characters.
324 L"\x0E23\x0E39\x0E49", L"\x0E2A\x0E36", L"\x0E01", L" ",
326 std::vector<string16> characters;
328 for (size_t i = 0; i < arraysize(kCharacters); ++i) {
329 characters.push_back(WideToUTF16(kCharacters[i]));
330 text.append(characters.back());
332 BreakIterator iter(text, BreakIterator::BREAK_CHARACTER);
333 ASSERT_TRUE(iter.Init());
334 for (size_t i = 0; i < arraysize(kCharacters); ++i) {
335 EXPECT_TRUE(iter.Advance());
336 EXPECT_EQ(characters[i], iter.GetString());
340 // Test for https://code.google.com/p/chromium/issues/detail?id=411213
341 // We should be able to get valid substrings with GetString() function
342 // after setting new content by calling SetText().
343 TEST(BreakIteratorTest, GetStringAfterSetText) {
344 const string16 initial_string(ASCIIToUTF16("str"));
345 BreakIterator iter(initial_string, BreakIterator::BREAK_WORD);
346 ASSERT_TRUE(iter.Init());
348 const string16 long_string(ASCIIToUTF16("another,string"));
349 EXPECT_TRUE(iter.SetText(long_string.c_str(), long_string.size()));
350 EXPECT_TRUE(iter.Advance());
351 EXPECT_TRUE(iter.Advance()); // Advance to ',' in |long_string|
353 // Check that the current position is out of bounds of the |initial_string|.
354 EXPECT_LT(initial_string.size(), iter.pos());
356 // Check that we can get a valid substring of |long_string|.
357 EXPECT_EQ(ASCIIToUTF16(","), iter.GetString());
360 TEST(BreakIteratorTest, GetStringPiece) {
361 const string16 initial_string(ASCIIToUTF16("some string"));
362 BreakIterator iter(initial_string, BreakIterator::BREAK_WORD);
363 ASSERT_TRUE(iter.Init());
365 EXPECT_TRUE(iter.Advance());
366 EXPECT_EQ(iter.GetString(), iter.GetStringPiece().as_string());
367 EXPECT_EQ(StringPiece16(ASCIIToUTF16("some")), iter.GetStringPiece());
369 EXPECT_TRUE(iter.Advance());
370 EXPECT_TRUE(iter.Advance());
371 EXPECT_EQ(iter.GetString(), iter.GetStringPiece().as_string());
372 EXPECT_EQ(StringPiece16(ASCIIToUTF16("string")), iter.GetStringPiece());
375 // Make sure that when not in RULE_BASED or BREAK_WORD mode we're getting
376 // IS_LINE_OR_CHAR_BREAK.
377 TEST(BreakIteratorTest, GetWordBreakStatusBreakLine) {
378 // A string containing the English word "foo", followed by two Khmer
379 // characters, the English word "Can", and then two Russian characters and
382 base::WideToUTF16(L"foo \x1791\x17C1 \nCan \x041C\x0438..."));
383 BreakIterator iter(text, BreakIterator::BREAK_LINE);
384 ASSERT_TRUE(iter.Init());
386 EXPECT_TRUE(iter.Advance());
387 // Finds "foo" and the space.
388 EXPECT_EQ(base::UTF8ToUTF16("foo "), iter.GetString());
389 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
390 EXPECT_TRUE(iter.Advance());
391 // Finds the Khmer characters, the next space, and the newline.
392 EXPECT_EQ(base::WideToUTF16(L"\x1791\x17C1 \n"), iter.GetString());
393 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
394 EXPECT_TRUE(iter.Advance());
395 // Finds "Can" and the space.
396 EXPECT_EQ(base::UTF8ToUTF16("Can "), iter.GetString());
397 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
398 EXPECT_TRUE(iter.Advance());
399 // Finds the Russian characters and periods.
400 EXPECT_EQ(base::WideToUTF16(L"\x041C\x0438..."), iter.GetString());
401 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_LINE_OR_CHAR_BREAK);
402 EXPECT_FALSE(iter.Advance());
405 // Make sure that in BREAK_WORD mode we're getting IS_WORD_BREAK and
406 // IS_SKIPPABLE_WORD when we should be. IS_WORD_BREAK should be returned when we
407 // finish going over non-punctuation characters while IS_SKIPPABLE_WORD should
408 // be returned on punctuation and spaces.
409 TEST(BreakIteratorTest, GetWordBreakStatusBreakWord) {
410 // A string containing the English word "foo", followed by two Khmer
411 // characters, the English word "Can", and then two Russian characters and
414 base::WideToUTF16(L"foo \x1791\x17C1 \nCan \x041C\x0438..."));
415 BreakIterator iter(text, BreakIterator::BREAK_WORD);
416 ASSERT_TRUE(iter.Init());
418 EXPECT_TRUE(iter.Advance());
420 EXPECT_EQ(base::UTF8ToUTF16("foo"), iter.GetString());
421 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
422 EXPECT_TRUE(iter.Advance());
423 // Finds the space, and the Khmer characters.
424 EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
425 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
426 EXPECT_TRUE(iter.Advance());
427 EXPECT_EQ(base::WideToUTF16(L"\x1791\x17C1"), iter.GetString());
428 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
429 EXPECT_TRUE(iter.Advance());
430 // Finds the space and the newline.
431 EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
432 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
433 EXPECT_TRUE(iter.Advance());
434 EXPECT_EQ(base::UTF8ToUTF16("\n"), iter.GetString());
435 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
436 EXPECT_TRUE(iter.Advance());
438 EXPECT_EQ(base::UTF8ToUTF16("Can"), iter.GetString());
439 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
440 EXPECT_TRUE(iter.Advance());
441 // Finds the space and the Russian characters.
442 EXPECT_EQ(base::UTF8ToUTF16(" "), iter.GetString());
443 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
444 EXPECT_TRUE(iter.Advance());
445 EXPECT_EQ(base::WideToUTF16(L"\x041C\x0438"), iter.GetString());
446 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_WORD_BREAK);
447 EXPECT_TRUE(iter.Advance());
448 // Finds the trailing periods.
449 EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
450 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
451 EXPECT_TRUE(iter.Advance());
452 EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
453 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
454 EXPECT_TRUE(iter.Advance());
455 EXPECT_EQ(base::UTF8ToUTF16("."), iter.GetString());
456 EXPECT_EQ(iter.GetWordBreakStatus(), BreakIterator::IS_SKIPPABLE_WORD);
457 EXPECT_FALSE(iter.Advance());