summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 15:42:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 15:42:00 +0000
commit7024d3eea1d8328883736f5cd3cbef480aa0e740 (patch)
tree5fc40e7da24d79306321037359bce7bd97bcf36b /chrome/tools
parente9ff5e31b28b6ee684ceaf47afe4f483163f6d1d (diff)
downloadchromium_src-7024d3eea1d8328883736f5cd3cbef480aa0e740.zip
chromium_src-7024d3eea1d8328883736f5cd3cbef480aa0e740.tar.gz
chromium_src-7024d3eea1d8328883736f5cd3cbef480aa0e740.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/6312154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74118 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);
}