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

Unified Diff: chrome/renderer/spellchecker/spellcheck_unittest.cc

Issue 105493002: Use base namespace for string16 in chrome/renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/spellchecker/spellcheck_unittest.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_unittest.cc b/chrome/renderer/spellchecker/spellcheck_unittest.cc
index 47c5a29057d8fc7e619b1e1b59e7502e4fd18531..143770e5608948fd57cb68f28cfd0a3d89bd9da6 100644
--- a/chrome/renderer/spellchecker/spellcheck_unittest.cc
+++ b/chrome/renderer/spellchecker/spellcheck_unittest.cc
@@ -85,7 +85,7 @@ class SpellCheckTest : public testing::Test {
#if !defined(OS_MACOSX)
protected:
void TestSpellCheckParagraph(
- const string16& input,
+ const base::string16& input,
const std::vector<SpellCheckResult>& expected) {
blink::WebVector<blink::WebTextCheckingResult> results;
spell_check()->SpellCheckParagraph(input,
@@ -431,7 +431,7 @@ TEST_F(SpellCheckTest, SpellCheckSuggestions_EN_US) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- std::vector<string16> suggestions;
+ std::vector<base::string16> suggestions;
size_t input_length = 0;
if (kTestCases[i].input != NULL) {
input_length = wcslen(kTestCases[i].input);
@@ -841,10 +841,10 @@ TEST_F(SpellCheckTest, GetAutoCorrectionWord_EN_US) {
EnableAutoCorrect(true);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- string16 misspelled_word(UTF8ToUTF16(kTestCases[i].input));
- string16 expected_autocorrect_word(
+ base::string16 misspelled_word(UTF8ToUTF16(kTestCases[i].input));
+ base::string16 expected_autocorrect_word(
UTF8ToUTF16(kTestCases[i].expected_result));
- string16 autocorrect_word = spell_check()->GetAutoCorrectionWord(
+ base::string16 autocorrect_word = spell_check()->GetAutoCorrectionWord(
misspelled_word, 0);
// Check for spelling.
@@ -885,7 +885,7 @@ TEST_F(SpellCheckTest, MisspelledWords) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
ReinitializeSpellCheck(kTestCases[i].language);
- string16 word(WideToUTF16(kTestCases[i].input));
+ base::string16 word(WideToUTF16(kTestCases[i].input));
int word_length = static_cast<int>(word.length());
int misspelling_start = 0;
int misspelling_length = 0;
@@ -913,14 +913,14 @@ TEST_F(SpellCheckTest, SpellCheckParagraphEmptyParagraph) {
// A simple test case having no misspellings.
TEST_F(SpellCheckTest, SpellCheckParagraphNoMisspellings) {
- const string16 text = UTF8ToUTF16("apple");
+ const base::string16 text = UTF8ToUTF16("apple");
std::vector<SpellCheckResult> expected;
TestSpellCheckParagraph(text, expected);
}
// A simple test case having one misspelling.
TEST_F(SpellCheckTest, SpellCheckParagraphSingleMisspellings) {
- const string16 text = UTF8ToUTF16("zz");
+ const base::string16 text = UTF8ToUTF16("zz");
std::vector<SpellCheckResult> expected;
expected.push_back(SpellCheckResult(
SpellCheckResult::SPELLING, 0, 2));
@@ -930,7 +930,7 @@ TEST_F(SpellCheckTest, SpellCheckParagraphSingleMisspellings) {
// A simple test case having multiple misspellings.
TEST_F(SpellCheckTest, SpellCheckParagraphMultipleMisspellings) {
- const string16 text = UTF8ToUTF16("zz, zz");
+ const base::string16 text = UTF8ToUTF16("zz, zz");
std::vector<SpellCheckResult> expected;
expected.push_back(SpellCheckResult(
SpellCheckResult::SPELLING, 0, 2));
@@ -944,7 +944,7 @@ TEST_F(SpellCheckTest, SpellCheckParagraphMultipleMisspellings) {
TEST_F(SpellCheckTest, SpellCheckParagraphLongSentence) {
std::vector<SpellCheckResult> expected;
// The text is taken from US constitution preamble.
- const string16 text = UTF8ToUTF16(
+ const base::string16 text = UTF8ToUTF16(
"We the people of the United States, in order to form a more perfect "
"union, establish justice, insure domestic tranquility, provide for "
"the common defense, promote the general welfare, and secure the "
@@ -959,7 +959,7 @@ TEST_F(SpellCheckTest, SpellCheckParagraphLongSentenceMultipleMisspellings) {
std::vector<SpellCheckResult> expected;
// All 'the' are converted to 'hte' in US consitition preamble.
- const string16 text = UTF8ToUTF16(
+ const base::string16 text = UTF8ToUTF16(
"We hte people of hte United States, in order to form a more perfect "
"union, establish justice, insure domestic tranquility, provide for "
"hte common defense, promote hte general welfare, and secure hte "
@@ -989,7 +989,7 @@ TEST_F(SpellCheckTest, SpellCheckParagraphLongSentenceMultipleMisspellings) {
TEST_F(SpellCheckTest, RequestSpellCheckWithEmptyString) {
MockTextCheckingCompletion completion;
- spell_check()->RequestTextChecking(string16(), &completion);
+ spell_check()->RequestTextChecking(base::string16(), &completion);
base::MessageLoop::current()->RunUntilIdle();
@@ -1000,7 +1000,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckWithEmptyString) {
TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) {
MockTextCheckingCompletion completion;
- const string16 text = ASCIIToUTF16("hello");
+ const base::string16 text = ASCIIToUTF16("hello");
spell_check()->RequestTextChecking(text, &completion);
base::MessageLoop::current()->RunUntilIdle();
@@ -1012,7 +1012,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) {
TEST_F(SpellCheckTest, RequestSpellCheckWithSingleMisspelling) {
MockTextCheckingCompletion completion;
- const string16 text = ASCIIToUTF16("apple, zz");
+ const base::string16 text = ASCIIToUTF16("apple, zz");
spell_check()->RequestTextChecking(text, &completion);
base::MessageLoop::current()->RunUntilIdle();
@@ -1027,7 +1027,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckWithSingleMisspelling) {
TEST_F(SpellCheckTest, RequestSpellCheckWithMisspellings) {
MockTextCheckingCompletion completion;
- const string16 text = ASCIIToUTF16("apple, zz, orange, zz");
+ const base::string16 text = ASCIIToUTF16("apple, zz, orange, zz");
spell_check()->RequestTextChecking(text, &completion);
base::MessageLoop::current()->RunUntilIdle();
@@ -1045,7 +1045,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckWithMisspellings) {
TEST_F(SpellCheckTest, RequestSpellCheckWithMultipleRequests) {
MockTextCheckingCompletion completion[3];
- const string16 text[3] = {
+ const base::string16 text[3] = {
ASCIIToUTF16("what, zz"),
ASCIIToUTF16("apple, zz"),
ASCIIToUTF16("orange, zz")
@@ -1070,7 +1070,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckWithoutInitialization) {
UninitializeSpellCheck();
MockTextCheckingCompletion completion;
- const string16 text = ASCIIToUTF16("zz");
+ const base::string16 text = ASCIIToUTF16("zz");
spell_check()->RequestTextChecking(text, &completion);
@@ -1085,7 +1085,7 @@ TEST_F(SpellCheckTest, RequestSpellCheckMultipleTimesWithoutInitialization) {
UninitializeSpellCheck();
MockTextCheckingCompletion completion[3];
- const string16 text[3] = {
+ const base::string16 text[3] = {
ASCIIToUTF16("what, zz"),
ASCIIToUTF16("apple, zz"),
ASCIIToUTF16("orange, zz")
@@ -1117,10 +1117,10 @@ TEST_F(SpellCheckTest, CreateTextCheckingResults) {
// Verify that the SpellCheck class keeps the spelling marker added to a
// misspelled word "zz".
{
- string16 text = ASCIIToUTF16("zz");
+ base::string16 text = ASCIIToUTF16("zz");
std::vector<SpellCheckResult> spellcheck_results;
spellcheck_results.push_back(SpellCheckResult(
- SpellCheckResult::SPELLING, 0, 2, string16()));
+ SpellCheckResult::SPELLING, 0, 2, base::string16()));
blink::WebVector<blink::WebTextCheckingResult> textcheck_results;
spell_check()->CreateTextCheckingResults(SpellCheck::USE_NATIVE_CHECKER,
0,
@@ -1137,10 +1137,10 @@ TEST_F(SpellCheckTest, CreateTextCheckingResults) {
// Verify that the SpellCheck class replaces the spelling marker added to a
// contextually-misspelled word "bean" with a grammar marker.
{
- string16 text = ASCIIToUTF16("I have bean to USA.");
+ base::string16 text = ASCIIToUTF16("I have bean to USA.");
std::vector<SpellCheckResult> spellcheck_results;
spellcheck_results.push_back(SpellCheckResult(
- SpellCheckResult::SPELLING, 7, 4, string16()));
+ SpellCheckResult::SPELLING, 7, 4, base::string16()));
blink::WebVector<blink::WebTextCheckingResult> textcheck_results;
spell_check()->CreateTextCheckingResults(SpellCheck::USE_NATIVE_CHECKER,
0,
@@ -1254,7 +1254,7 @@ TEST_F(SpellCheckTest, NoSuggest) {
" in " << kTestCases[i].locale;
// Now verify that this test case does not show up as a suggestion.
- std::vector<string16> suggestions;
+ std::vector<base::string16> suggestions;
size_t input_length = 0;
if (kTestCases[i].input != NULL)
input_length = strlen(kTestCases[i].input);
@@ -1347,7 +1347,7 @@ TEST_F(SpellCheckTest, LogicalSuggestions) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
int misspelling_start = 0;
int misspelling_length = 0;
- std::vector<string16> suggestions;
+ std::vector<base::string16> suggestions;
EXPECT_FALSE(spell_check()->SpellCheckWord(
ASCIIToUTF16(kTestCases[i].misspelled).c_str(),
strlen(kTestCases[i].misspelled),
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider_test.cc ('k') | chrome/renderer/spellchecker/spellcheck_worditerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698