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

Unified Diff: chrome/test/url_fetch_test/url_fetch_test.cc

Issue 3057033: Remove GetSwitchValue() from chrome/* where easy. (Closed)
Patch Set: finally Created 10 years, 4 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/url_fetch_test/url_fetch_test.cc
diff --git a/chrome/test/url_fetch_test/url_fetch_test.cc b/chrome/test/url_fetch_test/url_fetch_test.cc
index ec87c76dc3008f0c8ea4d97ba11d4f1aef4c0044..5729785cf31134b62371f98aeb9f9216c40b698b 100644
--- a/chrome/test/url_fetch_test/url_fetch_test.cc
+++ b/chrome/test/url_fetch_test/url_fetch_test.cc
@@ -49,7 +49,7 @@ class UrlFetchTest : public UITest {
}
void RunTest(const GURL& url, const char* wait_cookie_name,
- const char* wait_cookie_value, const wchar_t* var_to_fetch,
+ const char* wait_cookie_value, const char* var_to_fetch,
UrlFetchTestResult* result) {
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url));
@@ -67,11 +67,12 @@ class UrlFetchTest : public UITest {
}
}
if (var_to_fetch) {
- std::wstring script = StringPrintf(
- L"window.domAutomationController.send(%ls);", var_to_fetch);
+ std::string script = StringPrintf(
+ "window.domAutomationController.send(%s);", var_to_fetch);
std::wstring value;
- bool success = tab->ExecuteAndExtractString(L"", script, &value);
+ bool success = tab->ExecuteAndExtractString(L"", ASCIIToWide(script),
+ &value);
ASSERT_TRUE(success);
result->javascript_variable = WideToUTF8(value);
}
@@ -121,10 +122,10 @@ TEST_F(UrlFetchTest, UrlFetch) {
std::string cookie_value =
cmd_line->GetSwitchValueASCII("wait_cookie_value");
- std::wstring jsvar = cmd_line->GetSwitchValue("jsvar");
+ std::string jsvar = cmd_line->GetSwitchValueASCII("jsvar");
UrlFetchTestResult result;
- RunTest(GURL(WideToASCII(cmd_line->GetSwitchValue("url"))),
+ RunTest(GURL(cmd_line->GetSwitchValueASCII("url")),
cookie_name.length() > 0 ? cookie_name.c_str() : NULL,
cookie_value.length() > 0 ? cookie_value.c_str() : NULL,
jsvar.length() > 0 ? jsvar.c_str() : NULL,

Powered by Google App Engine
This is Rietveld 408576698