summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui/omnibox_uitest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/ui/omnibox_uitest.cc')
-rw-r--r--chrome/test/ui/omnibox_uitest.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/chrome/test/ui/omnibox_uitest.cc b/chrome/test/ui/omnibox_uitest.cc
index b30f91d..f4f24fa 100644
--- a/chrome/test/ui/omnibox_uitest.cc
+++ b/chrome/test/ui/omnibox_uitest.cc
@@ -52,20 +52,22 @@ class OmniboxTest : public UITest {
// http://www.google.com/ is suggested that should be considered a match.
// This could probably be accomplished with regex as well. Note that this
// method is called even when suggestion isn't a URL.
- bool IsMatch(const std::wstring& input_test, const std::wstring& suggestion);
+ bool IsMatch(const string16& input_test, const string16& suggestion);
// Runs a query chain. This sends each proper prefix of the input to the
// omnibox and scores the autocompelte results returned.
- void RunQueryChain(const std::wstring& input_text);
+ void RunQueryChain(const string16& input_text);
};
-bool OmniboxTest::IsMatch(const std::wstring& input_text,
- const std::wstring& suggestion) {
+bool OmniboxTest::IsMatch(const string16& input_text,
+ const string16& suggestion) {
// This prefix list comes from the list used in history_url_provider.cc
// with the exception of "ftp." and "www.".
- std::wstring prefixes[] = {L"", L"ftp://", L"http://", L"https://",
- L"ftp.", L"www.", L"ftp://www.", L"ftp://ftp.",
- L"http://www.", L"https://www."};
- std::wstring postfixes[] = {L"", L"/"};
+ string16 prefixes[] = {ASCIIToUTF16(""), ASCIIToUTF16("ftp://"),
+ ASCIIToUTF16("http://"), ASCIIToUTF16("https://"), ASCIIToUTF16("ftp."),
+ ASCIIToUTF16("www."), ASCIIToUTF16("ftp://www."),
+ ASCIIToUTF16("ftp://ftp."), ASCIIToUTF16("http://www."),
+ ASCIIToUTF16("https://www.")};
+ string16 postfixes[] = {ASCIIToUTF16(""), ASCIIToUTF16("/")};
for (size_t i = 0; i < arraysize(prefixes); ++i) {
for (size_t j = 0; j < arraysize(postfixes); ++j) {
if (prefixes[i] + input_text + postfixes[j] == suggestion)
@@ -75,7 +77,7 @@ bool OmniboxTest::IsMatch(const std::wstring& input_text,
return false;
}
-void OmniboxTest::RunQueryChain(const std::wstring& input_text) {
+void OmniboxTest::RunQueryChain(const string16& input_text) {
// Get a handle on the omnibox and give it focus.
scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
ASSERT_TRUE(browser.get());
@@ -163,7 +165,7 @@ TEST_F(OmniboxTest, Measure) {
expected_providers.push_back(provider);
reader.Read();
}
- RunQueryChain(ASCIIToWide(query));
+ RunQueryChain(ASCIIToUTF16(query));
reader.Read();
}
reader.Read();