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

Unified Diff: webkit/tools/test_shell/test_shell_main.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 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
« no previous file with comments | « webkit/tools/test_shell/test_shell.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell_main.cc
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index d24c42dbe71eef1f42a50ee30a1a56549e4295f4..3e4ecf39f5b0f78ff4f6e47e7cf7bb83eb5136a2 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);
« no previous file with comments | « webkit/tools/test_shell/test_shell.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698