summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 22:57:43 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 22:57:43 +0000
commit548bc0f318c74e9a69973cb43c5403d03d114b52 (patch)
treeab09daafc56330f21985c85eabe8adfc671ab7a6 /chrome/tools
parent5963b7759a369d178866bdc5868bb601dc5ee262 (diff)
downloadchromium_src-548bc0f318c74e9a69973cb43c5403d03d114b52.zip
chromium_src-548bc0f318c74e9a69973cb43c5403d03d114b52.tar.gz
chromium_src-548bc0f318c74e9a69973cb43c5403d03d114b52.tar.bz2
Remove wstring from RVH's run Javascript command.
BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6458013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rw-r--r--chrome/tools/convert_dict/convert_dict_unittest.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/chrome/tools/convert_dict/convert_dict_unittest.cc b/chrome/tools/convert_dict/convert_dict_unittest.cc
index 5f56c69..f8d1971 100644
--- a/chrome/tools/convert_dict/convert_dict_unittest.cc
+++ b/chrome/tools/convert_dict/convert_dict_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -62,18 +62,18 @@ bool VerifyWords(const convert_dict::DicReader::WordList& org_words,
// * Creates bdict data.
// * Verify the bdict data.
void RunDictionaryTest(const char* codepage,
- const std::map<std::wstring, bool>& word_list) {
+ const std::map<string16, bool>& word_list) {
// Create an affix data and a dictionary data.
std::string aff_data(StringPrintf("SET %s\n", codepage));
std::string dic_data(StringPrintf("%" PRIuS "\n", word_list.size()));
- for (std::map<std::wstring, bool>::const_iterator it = word_list.begin();
+ for (std::map<string16, bool>::const_iterator it = word_list.begin();
it != word_list.end(); ++it) {
std::string encoded_word;
- EXPECT_TRUE(WideToCodepage(it->first,
- codepage,
- base::OnStringConversionError::FAIL,
- &encoded_word));
+ EXPECT_TRUE(UTF16ToCodepage(it->first,
+ codepage,
+ base::OnStringConversionError::FAIL,
+ &encoded_word));
dic_data += encoded_word;
dic_data += "\n";
}
@@ -101,7 +101,7 @@ void RunDictionaryTest(const char* codepage,
for (size_t i = 0; i < dic_reader.words().size(); ++i) {
SCOPED_TRACE(StringPrintf("dic_reader.words()[%" PRIuS "]: %s",
i, dic_reader.words()[i].first.c_str()));
- std::wstring word(UTF8ToWide(dic_reader.words()[i].first));
+ string16 word(UTF8ToUTF16(dic_reader.words()[i].first));
EXPECT_TRUE(word_list.find(word) != word_list.end());
}
@@ -149,9 +149,10 @@ TEST(ConvertDictTest, English) {
L"they",
};
- std::map<std::wstring, bool> word_list;
+ std::map<string16, bool> word_list;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i)
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true));
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]),
+ true));
RunDictionaryTest(kCodepage, word_list);
}
@@ -170,9 +171,10 @@ TEST(ConvertDictTest, Russian) {
L"\x043e\x043d\x0438",
};
- std::map<std::wstring, bool> word_list;
+ std::map<string16, bool> word_list;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i)
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true));
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]),
+ true));
RunDictionaryTest(kCodepage, word_list);
}
@@ -193,9 +195,10 @@ TEST(ConvertDictTest, Hungarian) {
L"\x006d\x0061\x0067\x0075\x006b",
};
- std::map<std::wstring, bool> word_list;
+ std::map<string16, bool> word_list;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i)
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true));
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]),
+ true));
RunDictionaryTest(kCodepage, word_list);
}