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

Side by Side Diff: webkit/tools/test_shell/test_shell_main.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/stack_trace.h" 8 #include "base/debug/stack_trace.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 .AppendASCII("test_shell").AppendASCII("index.html"); 220 .AppendASCII("test_shell").AppendASCII("index.html");
221 starting_url = net::FilePathToFileURL(path); 221 starting_url = net::FilePathToFileURL(path);
222 222
223 const CommandLine::StringVector& args = parsed_command_line.GetArgs(); 223 const CommandLine::StringVector& args = parsed_command_line.GetArgs();
224 if (!args.empty()) { 224 if (!args.empty()) {
225 GURL url(args[0]); 225 GURL url(args[0]);
226 if (url.is_valid()) { 226 if (url.is_valid()) {
227 starting_url = url; 227 starting_url = url;
228 } else { 228 } else {
229 // Treat as a relative file path. 229 // Treat as a relative file path.
230 base::FilePath path = base::FilePath(args[0]); 230 base::FilePath path = base::MakeAbsoluteFilePath(base::FilePath(args[0]));
231 file_util::AbsolutePath(&path);
232 starting_url = net::FilePathToFileURL(path); 231 starting_url = net::FilePathToFileURL(path);
233 } 232 }
234 } 233 }
235 234
236 // Get the JavaScript flags. The test runner might send a quoted string which 235 // Get the JavaScript flags. The test runner might send a quoted string which
237 // needs to be unquoted before further processing. 236 // needs to be unquoted before further processing.
238 std::string js_flags = 237 std::string js_flags =
239 parsed_command_line.GetSwitchValueASCII(test_shell::kJavaScriptFlags); 238 parsed_command_line.GetSwitchValueASCII(test_shell::kJavaScriptFlags);
240 js_flags = net::HttpUtil::Unquote(js_flags); 239 js_flags = net::HttpUtil::Unquote(js_flags);
241 // Split the JavaScript flags into a list. 240 // Split the JavaScript flags into a list.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 TestShell::ShutdownTestShell(); 285 TestShell::ShutdownTestShell();
287 TestShell::CleanupLogging(); 286 TestShell::CleanupLogging();
288 287
289 // Tear down shared StatsTable; prevents unit_tests from leaking it. 288 // Tear down shared StatsTable; prevents unit_tests from leaking it.
290 base::StatsTable::set_current(NULL); 289 base::StatsTable::set_current(NULL);
291 delete table; 290 delete table;
292 RemoveSharedMemoryFile(stats_filename); 291 RemoveSharedMemoryFile(stats_filename);
293 292
294 return 0; 293 return 0;
295 } 294 }
OLDNEW
« webkit/plugins/npapi/plugin_list_posix.cc ('K') | « webkit/support/webkit_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698