Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: chrome/renderer/spellchecker/spellcheck_worditerator_unittest.cc

Issue 11413054: [Spellcheck] Don't initialize SpellcheckWordIterator with empty rulesets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_worditerator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 string16 actual_word; 222 string16 actual_word;
223 int actual_start, actual_end; 223 int actual_start, actual_end;
224 EXPECT_TRUE(iterator.GetNextWord(&actual_word, &actual_start, &actual_end)); 224 EXPECT_TRUE(iterator.GetNextWord(&actual_word, &actual_start, &actual_end));
225 if (kTestCases[i].left_to_right) 225 if (kTestCases[i].left_to_right)
226 EXPECT_EQ(input_word, actual_word); 226 EXPECT_EQ(input_word, actual_word);
227 else 227 else
228 EXPECT_NE(input_word, actual_word); 228 EXPECT_NE(input_word, actual_word);
229 } 229 }
230 } 230 }
231
232 TEST(SpellcheckWordIteratorTest, Initialization) {
233 // Test initialization works when a default language is set.
234 {
235 SpellcheckCharAttribute attributes;
236 attributes.SetDefaultLanguage("en-US");
237
238 SpellcheckWordIterator iterator;
239 EXPECT_TRUE(iterator.Initialize(&attributes, true));
240 }
241
242 // Test initialization fails when no default language is set.
243 {
244 SpellcheckCharAttribute attributes;
245
246 SpellcheckWordIterator iterator;
247 EXPECT_FALSE(iterator.Initialize(&attributes, true));
248 }
249 }
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_worditerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698