summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc2
-rw-r--r--chrome/test/in_process_browser_test.cc14
-rw-r--r--chrome/test/memory_test/memory_test.cc3
-rw-r--r--chrome/test/nacl/nacl_sandbox_test.cc14
-rw-r--r--chrome/test/page_cycler/page_cycler_test.cc2
-rw-r--r--chrome/test/plugin/plugin_test.cpp2
-rw-r--r--chrome/test/ui/npapi_test_helper.cc4
-rw-r--r--chrome/test/ui/ppapi_uitest.cc13
-rw-r--r--chrome/test/ui/sandbox_uitests.cc2
-rw-r--r--chrome/test/ui/ui_test.cc19
-rw-r--r--chrome/test/ui_test_utils.cc8
11 files changed, 33 insertions, 50 deletions
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index ccdff3f..a16ac12 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -45,7 +45,7 @@ class AutomationProxyTest : public UITest {
AutomationProxyTest() {
dom_automation_enabled_ = true;
launch_arguments_.AppendSwitchWithValue(switches::kLang,
- L"en-US");
+ "en-US");
}
};
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index 0cbb39d..b8b8d90 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -136,15 +136,13 @@ void InProcessBrowserTest::SetUp() {
// Turn off tip loading for tests; see http://crbug.com/17725
command_line->AppendSwitch(switches::kDisableWebResources);
- command_line->AppendSwitchWithValue(switches::kUserDataDir,
- user_data_dir.ToWStringHack());
+ command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
// Don't show the first run ui.
command_line->AppendSwitch(switches::kNoFirstRun);
// This is a Browser test.
- command_line->AppendSwitchWithValue(switches::kTestType,
- ASCIIToWide(kBrowserTestType));
+ command_line->AppendSwitchWithValue(switches::kTestType, kBrowserTestType);
// Single-process mode is not set in BrowserMain so it needs to be processed
// explicitly.
@@ -155,8 +153,8 @@ void InProcessBrowserTest::SetUp() {
#if defined(OS_WIN)
// The Windows sandbox requires that the browser and child processes are the
// same binary. So we launch browser_process.exe which loads chrome.dll
- command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath,
- command_line->GetProgram().value());
+ command_line->AppendSwitchPath(switches::kBrowserSubprocessPath,
+ command_line->GetProgram());
#else
// Explicitly set the path of the binary used for child processes, otherwise
// they'll try to use browser_tests which doesn't contain ChromeMain.
@@ -165,8 +163,8 @@ void InProcessBrowserTest::SetUp() {
subprocess_path = subprocess_path.DirName();
subprocess_path = subprocess_path.AppendASCII(WideToASCII(
chrome::kBrowserProcessExecutablePath));
- command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath,
- subprocess_path.ToWStringHack());
+ command_line->AppendSwitchPath(switches::kBrowserSubprocessPath,
+ subprocess_path);
#endif
// Enable warning level logging so that we can see when bad stuff happens.
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index 079e0a4..249cf16 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -116,8 +116,7 @@ class MemoryTest : public UITest {
browser_directory_ = browser_dir;
}
- launch_arguments_.AppendSwitchWithValue(switches::kUserDataDir,
- user_data_dir_.ToWStringHack());
+ launch_arguments_.AppendSwitchPath(switches::kUserDataDir, user_data_dir_);
UITest::SetUp();
}
diff --git a/chrome/test/nacl/nacl_sandbox_test.cc b/chrome/test/nacl/nacl_sandbox_test.cc
index 41aa97a..2517403 100644
--- a/chrome/test/nacl/nacl_sandbox_test.cc
+++ b/chrome/test/nacl/nacl_sandbox_test.cc
@@ -18,18 +18,16 @@ const FilePath::CharType kSrpcHwHtmlFileName[] =
NaClSandboxTest::NaClSandboxTest() : NaClTest() {
// Append the --test-nacl-sandbox=$TESTDLL flag before launching.
- FilePath dylibDir;
- PathService::Get(base::DIR_EXE, &dylibDir);
+ FilePath dylib_dir;
+ PathService::Get(base::DIR_EXE, &dylib_dir);
#if defined(OS_MACOSX)
- dylibDir = dylibDir.AppendASCII("libnacl_security_tests.dylib");
- launch_arguments_.AppendSwitchWithValue(switches::kTestNaClSandbox,
- dylibDir.value());
+ dylib_dir = dylib_dir.AppendASCII("libnacl_security_tests.dylib");
+ launch_arguments_.AppendSwitchPath(switches::kTestNaClSandbox, dylib_dir);
#elif defined(OS_WIN)
// Let the NaCl process detect if it is 64-bit or not and hack on
// the appropriate suffix to this dll.
- dylibDir = dylibDir.AppendASCII("nacl_security_tests");
- launch_arguments_.AppendSwitchWithValue(switches::kTestNaClSandbox,
- dylibDir.value());
+ dylib_dir = dylib_dir.AppendASCII("nacl_security_tests");
+ launch_arguments_.AppendSwitchPath(switches::kTestNaClSandbox, dylib_dir);
#elif defined(OS_LINUX)
// We currently do not test the Chrome Linux SUID or seccomp sandboxes.
#endif
diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc
index 1f5b49a..45bf07a 100644
--- a/chrome/test/page_cycler/page_cycler_test.cc
+++ b/chrome/test/page_cycler/page_cycler_test.cc
@@ -163,7 +163,7 @@ class PageCyclerTest : public UITest {
// Expose garbage collection for the page cycler tests.
launch_arguments_.AppendSwitchWithValue(switches::kJavaScriptFlags,
- L"--expose_gc");
+ "--expose_gc");
#if defined(OS_MACOSX)
static rlim_t initial_fd_limit = GetFileDescriptorLimit();
fd_limit_ = initial_fd_limit;
diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp
index d8c81a5..80643b7 100644
--- a/chrome/test/plugin/plugin_test.cpp
+++ b/chrome/test/plugin/plugin_test.cpp
@@ -65,7 +65,7 @@ class PluginTest : public UITest {
launch_arguments_.AppendSwitch(kUseOldWMPPluginSwitch);
} else if (strcmp(test_info->name(), "FlashSecurity") == 0) {
launch_arguments_.AppendSwitchWithValue(switches::kTestSandbox,
- L"security_tests.dll");
+ "security_tests.dll");
}
UITest::SetUp();
diff --git a/chrome/test/ui/npapi_test_helper.cc b/chrome/test/ui/npapi_test_helper.cc
index 18e71a0..2bf6f10 100644
--- a/chrome/test/ui/npapi_test_helper.cc
+++ b/chrome/test/ui/npapi_test_helper.cc
@@ -49,8 +49,8 @@ void NPAPITesterBase::SetUp() {
#if defined(OS_MACOSX)
// The plugins directory isn't read by default on the Mac, so it needs to be
// explicitly registered.
- launch_arguments_.AppendSwitchWithValue(switches::kExtraPluginDir,
- plugins_directory.value());
+ launch_arguments_.AppendSwitchPath(switches::kExtraPluginDir,
+ plugins_directory);
#endif
UITest::SetUp();
diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc
index 5cb4aa8..b012262 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -36,15 +36,10 @@ class PPAPITest : public UITest {
FilePath plugin_lib = plugin_dir.Append(library_name);
EXPECT_TRUE(file_util::PathExists(plugin_lib));
-
-#if defined(OS_WIN)
- std::wstring pepper_plugin = plugin_lib.value();
-#else
- std::wstring pepper_plugin = UTF8ToWide(plugin_lib.value());
-#endif
- pepper_plugin.append(L";application/x-ppapi-tests");
- launch_arguments_.AppendSwitchWithValue(switches::kRegisterPepperPlugins,
- pepper_plugin);
+ FilePath::StringType pepper_plugin = plugin_lib.value();
+ pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests"));
+ launch_arguments_.AppendSwitchNative(switches::kRegisterPepperPlugins,
+ pepper_plugin);
// The test sends us the result via a cookie.
launch_arguments_.AppendSwitch(switches::kEnableFileCookies);
diff --git a/chrome/test/ui/sandbox_uitests.cc b/chrome/test/ui/sandbox_uitests.cc
index 85d4708..172028b 100644
--- a/chrome/test/ui/sandbox_uitests.cc
+++ b/chrome/test/ui/sandbox_uitests.cc
@@ -14,7 +14,7 @@ class SandboxTest : public UITest {
// Launches chrome with the --test-sandbox=security_tests.dll flag.
SandboxTest() : UITest() {
launch_arguments_.AppendSwitchWithValue(switches::kTestSandbox,
- L"security_tests.dll");
+ "security_tests.dll");
}
};
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 3b92b99..f3eff50 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -336,7 +336,7 @@ void UITestBase::StartHttpServerWithPort(const FilePath& root_directory,
ASSERT_TRUE(cmd_line.get());
cmd_line->AppendSwitchWithValue("server", "start");
cmd_line->AppendSwitch("register_cygwin");
- cmd_line->AppendSwitchWithValue("root", root_directory.ToWStringHack());
+ cmd_line->AppendSwitchPath("root", root_directory);
// For Windows 7, if we start the lighttpd server on the foreground mode,
// it will mess up with the command window and cause conhost.exe to crash. To
@@ -1118,12 +1118,10 @@ bool UITestBase::LaunchBrowserHelper(const CommandLine& arguments,
command_line.AppendSwitch(switches::kNoDefaultBrowserCheck);
// This is a UI test.
- command_line.AppendSwitchWithValue(switches::kTestType,
- ASCIIToWide(kUITestType));
+ command_line.AppendSwitchWithValue(switches::kTestType, kUITestType);
// Tell the browser to use a temporary directory just for this test.
- command_line.AppendSwitchWithValue(switches::kUserDataDir,
- user_data_dir().ToWStringHack());
+ command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir());
// We need cookies on file:// for things like the page cycler.
if (enable_file_cookies_)
@@ -1134,7 +1132,7 @@ bool UITestBase::LaunchBrowserHelper(const CommandLine& arguments,
if (include_testing_id_) {
command_line.AppendSwitchWithValue(switches::kTestingChannelID,
- ASCIIToWide(server_->channel_id()));
+ server_->channel_id());
}
if (!show_error_dialogs_ &&
@@ -1156,14 +1154,12 @@ bool UITestBase::LaunchBrowserHelper(const CommandLine& arguments,
if (disable_breakpad_)
command_line.AppendSwitch(switches::kDisableBreakpad);
if (!homepage_.empty())
- command_line.AppendSwitchWithValue(switches::kHomePage,
- homepage_);
+ command_line.AppendSwitchWithValue(switches::kHomePage, homepage_);
// Don't try to fetch web resources during UI testing.
command_line.AppendSwitch(switches::kDisableWebResources);
if (!js_flags_.empty())
- command_line.AppendSwitchWithValue(switches::kJavaScriptFlags,
- js_flags_);
+ command_line.AppendSwitchWithValue(switches::kJavaScriptFlags, js_flags_);
if (!log_level_.empty())
command_line.AppendSwitchWithValue(switches::kLoggingLevel, log_level_);
@@ -1180,8 +1176,7 @@ bool UITestBase::LaunchBrowserHelper(const CommandLine& arguments,
#endif
if (!ui_test_name_.empty())
- command_line.AppendSwitchWithValue(switches::kTestName,
- ui_test_name_);
+ command_line.AppendSwitchWithValue(switches::kTestName, ui_test_name_);
// The tests assume that file:// URIs can freely access other file:// URIs.
command_line.AppendSwitch(switches::kAllowFileAccessFromFiles);
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index 8e11ebf..a1abccd 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -618,11 +618,10 @@ TestWebSocketServer::TestWebSocketServer(const FilePath& root_directory) {
cmd_line->AppendSwitchWithValue("server", "start");
cmd_line->AppendSwitch("chromium");
cmd_line->AppendSwitch("register_cygwin");
- cmd_line->AppendSwitchWithValue("root", root_directory.ToWStringHack());
+ cmd_line->AppendSwitchPath("root", root_directory);
temp_dir_.CreateUniqueTempDir();
websocket_pid_file_ = temp_dir_.path().AppendASCII("websocket.pid");
- cmd_line->AppendSwitchWithValue("pidfile",
- websocket_pid_file_.ToWStringHack());
+ cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_);
SetPythonPath();
base::LaunchApp(*cmd_line.get(), true, false, NULL);
}
@@ -664,8 +663,7 @@ TestWebSocketServer::~TestWebSocketServer() {
scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine());
cmd_line->AppendSwitchWithValue("server", "stop");
cmd_line->AppendSwitch("chromium");
- cmd_line->AppendSwitchWithValue("pidfile",
- websocket_pid_file_.ToWStringHack());
+ cmd_line->AppendSwitchPath("pidfile", websocket_pid_file_);
base::LaunchApp(*cmd_line.get(), true, false, NULL);
}