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

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

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/renderer/spellchecker/custom_dictionary_engine.h" 6 #include "chrome/renderer/spellchecker/custom_dictionary_engine.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 TEST(CustomDictionaryTest, HandlesEmptyWordWithInvalidSubstring) { 9 TEST(CustomDictionaryTest, HandlesEmptyWordWithInvalidSubstring) {
10 CustomDictionaryEngine engine; 10 CustomDictionaryEngine engine;
11 std::set<std::string> custom_words; 11 std::set<std::string> custom_words;
12 engine.Init(custom_words); 12 engine.Init(custom_words);
13 EXPECT_FALSE(engine.SpellCheckWord(base::string16().c_str(), 15, 23)); 13 EXPECT_FALSE(engine.SpellCheckWord(base::string16().c_str(), 15, 23));
14 } 14 }
15 15
16 TEST(CustomDictionaryTest, Basic) { 16 TEST(CustomDictionaryTest, Basic) {
17 CustomDictionaryEngine engine; 17 CustomDictionaryEngine engine;
18 EXPECT_FALSE(engine.SpellCheckWord(base::ASCIIToUTF16("helllo").c_str(), 18 EXPECT_FALSE(engine.SpellCheckWord(base::ASCIIToUTF16("helllo").c_str(),
19 0, 6)); 19 0, 6));
20 std::set<std::string> custom_words; 20 std::set<std::string> custom_words;
21 custom_words.insert("helllo"); 21 custom_words.insert("helllo");
22 engine.Init(custom_words); 22 engine.Init(custom_words);
23 EXPECT_TRUE(engine.SpellCheckWord(base::ASCIIToUTF16("helllo").c_str(), 23 EXPECT_TRUE(engine.SpellCheckWord(base::ASCIIToUTF16("helllo").c_str(),
24 0, 6)); 24 0, 6));
25 } 25 }
26 26
27 TEST(CustomDictionaryTest, HandlesNullCharacters) { 27 TEST(CustomDictionaryTest, HandlesNullCharacters) {
28 char16 data[4] = {'a', 0, 'b', 'c'}; 28 base::char16 data[4] = {'a', 0, 'b', 'c'};
29 EXPECT_FALSE(CustomDictionaryEngine().SpellCheckWord(data, 1, 1)); 29 EXPECT_FALSE(CustomDictionaryEngine().SpellCheckWord(data, 1, 1));
30 } 30 }
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox_extension.cc ('k') | chrome/renderer/spellchecker/spellcheck.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698