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

Unified Diff: webkit/tools/test_shell/mac/main.mm

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/glue/plugins/plugin_list_win.cc ('k') | webkit/tools/test_shell/node_leak_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/mac/main.mm
diff --git a/webkit/tools/test_shell/mac/main.mm b/webkit/tools/test_shell/mac/main.mm
index 19c35075b99695a5bc4c1a4d63caef531ed22e80..535ac2431ac42ce8716a99b0b9923132900b0647 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
« no previous file with comments | « webkit/glue/plugins/plugin_list_win.cc ('k') | webkit/tools/test_shell/node_leak_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698