summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/mac/main.mm16
-rw-r--r--webkit/tools/test_shell/node_leak_test.cc12
-rw-r--r--webkit/tools/test_shell/run_all_tests.cc6
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc2
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc19
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc2
6 files changed, 26 insertions, 31 deletions
diff --git a/webkit/tools/test_shell/mac/main.mm b/webkit/tools/test_shell/mac/main.mm
index 19c3507..535ac24 100644
--- a/webkit/tools/test_shell/mac/main.mm
+++ b/webkit/tools/test_shell/mac/main.mm
@@ -115,8 +115,8 @@ int main(const int argc, const char *argv[]) {
// the windows version, so that we can run the same test scripts. stop
// if we hit something that's not a switch (like, oh, a URL).
- CommandLine::SetArgcArgv(argc, argv);
- CommandLine parsed_command_line(argc, argv);
+ CommandLine::Init(argc, argv);
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
if (parsed_command_line.HasSwitch(test_shell::kCheckLayoutTestSystemDeps)) {
// Always succeed the deps check, currently just used by windows port.
@@ -167,7 +167,7 @@ int main(const int argc, const char *argv[]) {
std::wstring javascript_flags =
parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags);
// Test shell always exposes the GC.
- CommandLine::AppendSwitch(&javascript_flags, L"expose-gc");
+ javascript_flags += L" --expose-gc";
webkit_glue::SetJavaScriptFlags(javascript_flags);
// Load and initialize the stats table (one per process, so that multiple
@@ -235,12 +235,10 @@ int main(const int argc, const char *argv[]) {
uri = UTF8ToWide([testShellURL UTF8String]);
}
- if (parsed_command_line.GetLooseValueCount() > 0) {
- CommandLine::LooseValueIterator iter =
- parsed_command_line.GetLooseValuesBegin();
- uri = *iter;
- }
-
+ std::vector<std::wstring> values = parsed_command_line.GetLooseValues();
+ if (values.size() > 0)
+ uri = values[0];
+
TestShell* shell;
if (TestShell::CreateNewWindow(uri, &shell)) {
#ifdef NOTYET
diff --git a/webkit/tools/test_shell/node_leak_test.cc b/webkit/tools/test_shell/node_leak_test.cc
index 97549c6..f24172a 100644
--- a/webkit/tools/test_shell/node_leak_test.cc
+++ b/webkit/tools/test_shell/node_leak_test.cc
@@ -30,11 +30,11 @@ const wchar_t kTestUrlSwitch[] = L"test-url";
class NodeLeakTest : public TestShellTest {
public:
virtual void SetUp() {
- CommandLine parsed_command_line;
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
- std::wstring js_flags =
- parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags);
- CommandLine::AppendSwitch(&js_flags, L"expose-gc");
+ std::wstring js_flags =
+ parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags);
+ js_flags += L" --expose-gc";
webkit_glue::SetJavaScriptFlags(js_flags);
// Expose GCController to JavaScript as well.
webkit_glue::SetShouldExposeGCController(true);
@@ -66,7 +66,7 @@ class NodeLeakTest : public TestShellTest {
virtual void TearDown() {
TestShellTest::TearDown();
-
+
SimpleResourceLoaderBridge::Shutdown();
}
@@ -80,7 +80,7 @@ class NodeLeakTest : public TestShellTest {
};
TEST_F(NodeLeakTest, TestURL) {
- CommandLine parsed_command_line;
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
if (parsed_command_line.HasSwitch(kTestUrlSwitch)) {
NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str());
}
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc
index d7ff3d0..9d5cfb7 100644
--- a/webkit/tools/test_shell/run_all_tests.cc
+++ b/webkit/tools/test_shell/run_all_tests.cc
@@ -48,15 +48,13 @@ int main(int argc, char* argv[]) {
base::EnableTerminationOnHeapCorruption();
// Some unittests may use base::Singleton<>, thus we need to instanciate
// the AtExitManager or else we will leak objects.
- base::AtExitManager at_exit_manager;
+ base::AtExitManager at_exit_manager;
#if defined(OS_LINUX)
gtk_init(&argc, &argv);
#endif
-#if defined(OS_POSIX)
- CommandLine::SetArgcArgv(argc, argv);
-#endif
+ CommandLine::Init(argc, argv);
// Suppress error dialogs and do not show GP fault error box on Windows.
TestShell::InitLogging(true, false, false);
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 3247022..ced93a5 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -501,7 +501,7 @@ void TestShell::SetFocus(WebWidgetHost* host, bool enable) {
namespace webkit_glue {
bool IsMediaPlayerAvailable() {
- return CommandLine().HasSwitch(test_shell::kEnableVideo);
+ return CommandLine::ForCurrentProcess()->HasSwitch(test_shell::kEnableVideo);
}
void PrefetchDns(const std::string& hostname) {}
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index d24c42d..3e4ecf3 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -134,11 +134,12 @@ int main(int argc, char* argv[]) {
#if defined(OS_LINUX)
gtk_init(&argc, &argv);
- // Only parse the command line after GTK's had a crack at it.
- CommandLine::SetArgcArgv(argc, argv);
#endif
- CommandLine parsed_command_line;
+ // Only parse the command line after GTK's had a crack at it.
+ CommandLine::Init(argc, argv);
+
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
if (parsed_command_line.HasSwitch(test_shell::kStartupDialog))
TestShell::ShowStartupDebuggingDialog();
@@ -265,16 +266,14 @@ int main(int argc, char* argv[]) {
file_util::AppendToPath(&uri, L"index.html");
}
- if (parsed_command_line.GetLooseValueCount() > 0) {
- CommandLine::LooseValueIterator iter(
- parsed_command_line.GetLooseValuesBegin());
- uri = *iter;
- }
+ std::vector<std::wstring> loose_values = parsed_command_line.GetLooseValues();
+ if (loose_values.size() > 0)
+ uri = loose_values[0];
- std::wstring js_flags =
+ std::wstring js_flags =
parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags);
// Test shell always exposes the GC.
- CommandLine::AppendSwitch(&js_flags, L"expose-gc");
+ js_flags += L" --expose-gc";
webkit_glue::SetJavaScriptFlags(js_flags);
// Also expose GCController to JavaScript.
webkit_glue::SetShouldExposeGCController(true);
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index a6ba571..81baf04 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -151,7 +151,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode) {
DCHECK(rc != 0);
}
- CommandLine parsed_command_line;
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
if (parsed_command_line.HasSwitch(test_shell::kCrashDumps)) {
std::wstring dir(
parsed_command_line.GetSwitchValue(test_shell::kCrashDumps));