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

Unified Diff: chrome/test/ui/omnibox_uitest.cc

Issue 6306011: Remove wstring from autocomplete. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/ui/omnibox_uitest.cc
===================================================================
--- chrome/test/ui/omnibox_uitest.cc (revision 72388)
+++ chrome/test/ui/omnibox_uitest.cc (working copy)
@@ -52,20 +52,22 @@
// 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 @@
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 @@
expected_providers.push_back(provider);
reader.Read();
}
- RunQueryChain(ASCIIToWide(query));
+ RunQueryChain(ASCIIToUTF16(query));
reader.Read();
}
reader.Read();
Property changes on: chrome/test/ui/omnibox_uitest.cc
___________________________________________________________________
Deleted: svn:mergeinfo

Powered by Google App Engine
This is Rietveld 408576698