diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 02:07:25 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 02:07:25 +0000 |
commit | b7e0a2a3ccf5aceb891d5e1dfaf9db1bbaaa5f78 (patch) | |
tree | d723b8556ad386a0b8a6e999e3a842e0bfe6f9b0 /chrome/test | |
parent | 1976d41ac728fcceb30f2df3c243cb7417f538f1 (diff) | |
download | chromium_src-b7e0a2a3ccf5aceb891d5e1dfaf9db1bbaaa5f78.zip chromium_src-b7e0a2a3ccf5aceb891d5e1dfaf9db1bbaaa5f78.tar.gz chromium_src-b7e0a2a3ccf5aceb891d5e1dfaf9db1bbaaa5f78.tar.bz2 |
Use ASCII strings for switch names.
Review URL: http://codereview.chromium.org/270062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.cc | 12 | ||||
-rw-r--r-- | chrome/test/mini_installer_test/run_all_unittests.cc | 4 | ||||
-rw-r--r-- | chrome/test/reliability/page_load_test.cc | 30 | ||||
-rw-r--r-- | chrome/test/test_launcher/out_of_proc_test_runner.cc | 8 | ||||
-rw-r--r-- | chrome/test/test_launcher/test_runner.cc | 5 | ||||
-rw-r--r-- | chrome/test/ui/dom_checker_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui/omnibox_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui/sunspider_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 24 | ||||
-rw-r--r-- | chrome/test/ui/ui_test_suite.cc | 8 | ||||
-rw-r--r-- | chrome/test/ui/ui_test_suite.h | 8 | ||||
-rw-r--r-- | chrome/test/ui/v8_benchmark_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/test/url_fetch_test/url_fetch_test.cc | 16 |
13 files changed, 61 insertions, 62 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 5c5ce9b..b4c8c29 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -36,17 +36,17 @@ namespace { -const wchar_t* const kReproSwitch = L"key"; +const char kReproSwitch[] = "key"; -const wchar_t* const kReproRepeatSwitch = L"num-reproductions"; +const char kReproRepeatSwitch[] = "num-reproductions"; -const wchar_t* const kInputFilePathSwitch = L"input"; +const char kInputFilePathSwitch[] = "input"; -const wchar_t* const kOutputFilePathSwitch = L"output"; +const char kOutputFilePathSwitch[] = "output"; -const wchar_t* const kDebugModeSwitch = L"debug"; +const char kDebugModeSwitch[] = "debug"; -const wchar_t* const kWaitSwitch = L"wait-after-action"; +const char kWaitSwitch[] = "wait-after-action"; const FilePath::CharType* const kDefaultInputFilePath = #if defined(OS_WIN) diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc index 7b982c6..767ead2 100644 --- a/chrome/test/mini_installer_test/run_all_unittests.cc +++ b/chrome/test/mini_installer_test/run_all_unittests.cc @@ -42,10 +42,10 @@ int main(int argc, char** argv) { // with cleaning the system or make a backup before continuing. CommandLine::Init(argc, argv); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(L"clean")) { + if (command_line.HasSwitch("clean")) { printf("Current version of Chrome will be uninstalled " "from all levels before proceeding with tests.\n"); - } else if (command_line.HasSwitch(L"backup")) { + } else if (command_line.HasSwitch("backup")) { BackUpProfile(); } else { printf("This test needs command line Arguments.\n"); diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 35ff013..250b51e 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -66,20 +66,20 @@ namespace { // See comments at the beginning of the file for the definition of switches. -const wchar_t kSiteSwitch[] = L"site"; -const wchar_t kStartPageSwitch[] = L"startpage"; -const wchar_t kEndPageSwitch[] = L"endpage"; -const wchar_t kListSwitch[] = L"list"; -const wchar_t kStartIndexSwitch[] = L"startline"; -const wchar_t kEndIndexSwitch[] = L"endline"; -const wchar_t kIterationSwitch[] = L"iterations"; -const wchar_t kContinuousLoadSwitch[] = L"continuousload"; -const wchar_t kMemoryUsageSwitch[] = L"memoryusage"; -const wchar_t kEndURLSwitch[] = L"endurl"; -const wchar_t kLogFileSwitch[] = L"logfile"; -const wchar_t kTimeoutSwitch[] = L"timeout"; -const wchar_t kNoPageDownSwitch[] = L"nopagedown"; -const wchar_t kSaveDebugLogSwitch[] = L"savedebuglog"; +const char kSiteSwitch[] = "site"; +const char kStartPageSwitch[] = "startpage"; +const char kEndPageSwitch[] = "endpage"; +const char kListSwitch[] = "list"; +const char kStartIndexSwitch[] = "startline"; +const char kEndIndexSwitch[] = "endline"; +const char kIterationSwitch[] = "iterations"; +const char kContinuousLoadSwitch[] = "continuousload"; +const char kMemoryUsageSwitch[] = "memoryusage"; +const char kEndURLSwitch[] = "endurl"; +const char kLogFileSwitch[] = "logfile"; +const char kTimeoutSwitch[] = "timeout"; +const char kNoPageDownSwitch[] = "nopagedown"; +const char kSaveDebugLogSwitch[] = "savedebuglog"; const char kDefaultServerUrl[] = "http://urllist.com"; std::string g_server_url; @@ -88,7 +88,7 @@ const char kTestPage2[] = "page2.html"; const char crash_url[] = "about:crash"; // These are copied from v8 definitions as we cannot include them. -const wchar_t kV8LogFileSwitch[] = L"logfile"; +const char kV8LogFileSwitch[] = "logfile"; const char kV8LogFileDefaultName[] = "v8.log"; // String name of local chrome dll for looking up file information. diff --git a/chrome/test/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc index 3d02bcb..dd1f5af 100644 --- a/chrome/test/test_launcher/out_of_proc_test_runner.cc +++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc @@ -15,8 +15,8 @@ namespace { -const wchar_t* const kGTestListTestsFlag = L"gtest_list_tests"; -const wchar_t* const kChildProcessFlag = L"child"; +const char kGTestListTestsFlag[] = "gtest_list_tests"; +const char kChildProcessFlag[] = "child"; class OutOfProcTestRunner : public tests::TestRunner { public: @@ -36,8 +36,8 @@ class OutOfProcTestRunner : public tests::TestRunner { CommandLine new_cmd_line(cmd_line->argv()); // Always enable disabled tests. This method is not called with disabled // tests unless this flag was specified to the browser test executable. - new_cmd_line.AppendSwitch(L"gtest_also_run_disabled_tests"); - new_cmd_line.AppendSwitchWithValue(L"gtest_filter", ASCIIToWide(test_name)); + new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); + new_cmd_line.AppendSwitchWithValue("gtest_filter", test_name); new_cmd_line.AppendSwitch(kChildProcessFlag); base::ProcessHandle process_handle; diff --git a/chrome/test/test_launcher/test_runner.cc b/chrome/test/test_launcher/test_runner.cc index 4fb34cd..fa4cc6e 100644 --- a/chrome/test/test_launcher/test_runner.cc +++ b/chrome/test/test_launcher/test_runner.cc @@ -14,9 +14,8 @@ namespace { -const wchar_t* const kGTestListTestsFlag = L"gtest_list_tests"; -const wchar_t* const kGTestRunDisabledTestsFlag = - L"gtest_also_run_disabled_tests"; +const char kGTestListTestsFlag[] = "gtest_list_tests"; +const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; // Retrieves the list of tests to run by running gtest with the // --gtest_list_tests flag in a forked process and parsing its output. diff --git a/chrome/test/ui/dom_checker_uitest.cc b/chrome/test/ui/dom_checker_uitest.cc index 37a50f7..e9a4996 100644 --- a/chrome/test/ui/dom_checker_uitest.cc +++ b/chrome/test/ui/dom_checker_uitest.cc @@ -27,7 +27,7 @@ static const FilePath::CharType kTestDirectory[] = static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("dom_checker.html"); -const wchar_t kRunDomCheckerTest[] = L"run-dom-checker-test"; +const char kRunDomCheckerTest[] = "run-dom-checker-test"; class DomCheckerTest : public UITest { public: diff --git a/chrome/test/ui/omnibox_uitest.cc b/chrome/test/ui/omnibox_uitest.cc index af94102..ebf5d7b 100644 --- a/chrome/test/ui/omnibox_uitest.cc +++ b/chrome/test/ui/omnibox_uitest.cc @@ -19,7 +19,7 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" -const wchar_t kRunOmniboxTest[] = L"run_omnibox_test"; +const char kRunOmniboxTest[] = "run_omnibox_test"; class OmniboxTest : public UITest { public: diff --git a/chrome/test/ui/sunspider_uitest.cc b/chrome/test/ui/sunspider_uitest.cc index 3f6c8f5..a3c20db 100644 --- a/chrome/test/ui/sunspider_uitest.cc +++ b/chrome/test/ui/sunspider_uitest.cc @@ -21,7 +21,7 @@ namespace { static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("sunspider-driver.html"); -const wchar_t kRunSunSpider[] = L"run-sunspider"; +const char kRunSunSpider[] = "run-sunspider"; class SunSpiderTest : public UITest { public: diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index cf49227..c4a37e2 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -77,17 +77,17 @@ std::wstring UITest::log_level_ = L""; // Specify the time (in milliseconds) that the ui_tests should wait before // timing out. This is used to specify longer timeouts when running under Purify // which requires much more time. -const wchar_t kUiTestTimeout[] = L"ui-test-timeout"; -const wchar_t kUiTestActionTimeout[] = L"ui-test-action-timeout"; -const wchar_t kUiTestActionMaxTimeout[] = L"ui-test-action-max-timeout"; -const wchar_t kUiTestSleepTimeout[] = L"ui-test-sleep-timeout"; -const wchar_t kUiTestTerminateTimeout[] = L"ui-test-terminate-timeout"; +const char kUiTestTimeout[] = "ui-test-timeout"; +const char kUiTestActionTimeout[] = "ui-test-action-timeout"; +const char kUiTestActionMaxTimeout[] = "ui-test-action-max-timeout"; +const char kUiTestSleepTimeout[] = "ui-test-sleep-timeout"; +const char kUiTestTerminateTimeout[] = "ui-test-terminate-timeout"; -const wchar_t kExtraChromeFlagsSwitch[] = L"extra-chrome-flags"; +const char kExtraChromeFlagsSwitch[] = "extra-chrome-flags"; // By default error dialogs are hidden, which makes debugging failures in the // slave process frustrating. By passing this in error dialogs are enabled. -const wchar_t kEnableErrorDialogs[] = L"enable-errdialogs"; +const char kEnableErrorDialogs[] = "enable-errdialogs"; // Uncomment this line to have the spawned process wait for the debugger to // attach. This only works on Windows. On posix systems, you can set the @@ -308,16 +308,16 @@ static void RunCommand(const CommandLine& cmd_line) { void UITest::StartHttpServer(const FilePath& root_directory) { scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); ASSERT_TRUE(cmd_line.get()); - cmd_line->AppendSwitchWithValue(L"server", L"start"); - cmd_line->AppendSwitch(L"register_cygwin"); - cmd_line->AppendSwitchWithValue(L"root", root_directory.ToWStringHack()); + cmd_line->AppendSwitchWithValue("server", "start"); + cmd_line->AppendSwitch("register_cygwin"); + cmd_line->AppendSwitchWithValue("root", root_directory.ToWStringHack()); // 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 // work around this, we start the http server on the background mode. #if defined(OS_WIN) if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7) - cmd_line->AppendSwitch(L"run_background"); + cmd_line->AppendSwitch("run_background"); #endif RunCommand(*cmd_line.get()); @@ -326,7 +326,7 @@ void UITest::StartHttpServer(const FilePath& root_directory) { void UITest::StopHttpServer() { scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); ASSERT_TRUE(cmd_line.get()); - cmd_line->AppendSwitchWithValue(L"server", L"stop"); + cmd_line->AppendSwitchWithValue("server", "stop"); RunCommand(*cmd_line.get()); } diff --git a/chrome/test/ui/ui_test_suite.cc b/chrome/test/ui/ui_test_suite.cc index 691a75f..a26000f 100644 --- a/chrome/test/ui/ui_test_suite.cc +++ b/chrome/test/ui/ui_test_suite.cc @@ -10,14 +10,14 @@ #include "chrome/common/env_vars.h" // Force a test to use an already running browser instance. UI tests only. -const wchar_t UITestSuite::kUseExistingBrowser[] = L"use-existing-browser"; +const char UITestSuite::kUseExistingBrowser[] = "use-existing-browser"; // Timeout for the test in milliseconds. UI tests only. -const wchar_t UITestSuite::kTestTimeout[] = L"test-timeout"; +const char UITestSuite::kTestTimeout[] = "test-timeout"; // Parameters to run test in parallel. UI tests only. -const wchar_t UITestSuite::kBatchCount[] = L"batch-count"; -const wchar_t UITestSuite::kBatchIndex[] = L"batch-index"; +const char UITestSuite::kBatchCount[] = "batch-count"; +const char UITestSuite::kBatchIndex[] = "batch-index"; const char UITestSuite::kGTestTotalShards[] = "GTEST_TOTAL_SHARDS="; const char UITestSuite::kGTestShardIndex[] = "GTEST_SHARD_INDEX="; diff --git a/chrome/test/ui/ui_test_suite.h b/chrome/test/ui/ui_test_suite.h index b5771cb..6354d5f 100644 --- a/chrome/test/ui/ui_test_suite.h +++ b/chrome/test/ui/ui_test_suite.h @@ -27,10 +27,10 @@ class UITestSuite : public ChromeTestSuite { base::ProcessHandle crash_service_; #endif - static const wchar_t kUseExistingBrowser[]; - static const wchar_t kTestTimeout[]; - static const wchar_t kBatchCount[]; - static const wchar_t kBatchIndex[]; + static const char kUseExistingBrowser[]; + static const char kTestTimeout[]; + static const char kBatchCount[]; + static const char kBatchIndex[]; static const char kGTestTotalShards[]; static const char kGTestShardIndex[]; }; diff --git a/chrome/test/ui/v8_benchmark_uitest.cc b/chrome/test/ui/v8_benchmark_uitest.cc index 103e47a..4a248f7 100644 --- a/chrome/test/ui/v8_benchmark_uitest.cc +++ b/chrome/test/ui/v8_benchmark_uitest.cc @@ -22,7 +22,7 @@ namespace { static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("run.html"); -const wchar_t kRunV8Benchmark[] = L"run-v8-benchmark"; +const char kRunV8Benchmark[] = "run-v8-benchmark"; class V8BenchmarkTest : public UITest { public: diff --git a/chrome/test/url_fetch_test/url_fetch_test.cc b/chrome/test/url_fetch_test/url_fetch_test.cc index 75be5ab..ed70f20 100644 --- a/chrome/test/url_fetch_test/url_fetch_test.cc +++ b/chrome/test/url_fetch_test/url_fetch_test.cc @@ -27,7 +27,7 @@ class UrlFetchTest : public UITest { void SetUp() { const CommandLine *cmdLine = CommandLine::ForCurrentProcess(); - if (cmdLine->HasSwitch(L"reference_build")) { + if (cmdLine->HasSwitch("reference_build")) { FilePath dir; PathService::Get(chrome::DIR_TEST_TOOLS, &dir); dir = dir.AppendASCII("reference_build"); @@ -109,19 +109,19 @@ bool writeValueToFile(std::string value, std::wstring filePath) { TEST_F(UrlFetchTest, UrlFetch) { const CommandLine *cmdLine = CommandLine::ForCurrentProcess(); - if (!cmdLine->HasSwitch(L"url")) { + if (!cmdLine->HasSwitch("url")) { return; } std::string cookieName = - WideToASCII(cmdLine->GetSwitchValue(L"wait_cookie_name")); + cmdLine->GetSwitchValueASCII("wait_cookie_name"); std::string cookieValue = - WideToASCII(cmdLine->GetSwitchValue(L"wait_cookie_value")); + cmdLine->GetSwitchValueASCII("wait_cookie_value"); - std::wstring jsvar = cmdLine->GetSwitchValue(L"jsvar"); + std::wstring jsvar = cmdLine->GetSwitchValue("jsvar"); UrlFetchTestResult result; - RunTest(GURL(WideToASCII(cmdLine->GetSwitchValue(L"url"))), + RunTest(GURL(WideToASCII(cmdLine->GetSwitchValue("url"))), cookieName.length() > 0 ? cookieName.c_str() : NULL, cookieValue.length() > 0 ? cookieValue.c_str() : NULL, jsvar.length() > 0 ? jsvar.c_str() : NULL, @@ -129,13 +129,13 @@ TEST_F(UrlFetchTest, UrlFetch) { // Write out the cookie if requested std::wstring cookieOutputPath = - cmdLine->GetSwitchValue(L"wait_cookie_output"); + cmdLine->GetSwitchValue("wait_cookie_output"); if (cookieOutputPath.length() > 0) { ASSERT_TRUE(writeValueToFile(result.cookie_value, cookieOutputPath)); } // Write out the JS Variable if requested - std::wstring jsvarOutputPath = cmdLine->GetSwitchValue(L"jsvar_output"); + std::wstring jsvarOutputPath = cmdLine->GetSwitchValue("jsvar_output"); if (jsvarOutputPath.length() > 0) { ASSERT_TRUE(writeValueToFile(result.javascript_variable, jsvarOutputPath)); } |