| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/event_recorder.h" | 10 #include "base/event_recorder.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 // Treat the first argument as the initial URL to open. | 229 // Treat the first argument as the initial URL to open. |
| 230 GURL starting_url; | 230 GURL starting_url; |
| 231 | 231 |
| 232 FilePath path; | 232 FilePath path; |
| 233 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 233 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 234 path = path.AppendASCII("webkit").AppendASCII("data") | 234 path = path.AppendASCII("webkit").AppendASCII("data") |
| 235 .AppendASCII("test_shell").AppendASCII("index.html"); | 235 .AppendASCII("test_shell").AppendASCII("index.html"); |
| 236 starting_url = net::FilePathToFileURL(path); | 236 starting_url = net::FilePathToFileURL(path); |
| 237 | 237 |
| 238 const std::vector<CommandLine::StringType>& args = parsed_command_line.args(); | 238 const CommandLine::StringVector& args = parsed_command_line.GetArgs(); |
| 239 if (!args.empty()) { | 239 if (!args.empty()) { |
| 240 GURL url(args[0]); | 240 GURL url(args[0]); |
| 241 if (url.is_valid()) { | 241 if (url.is_valid()) { |
| 242 starting_url = url; | 242 starting_url = url; |
| 243 } else { | 243 } else { |
| 244 // Treat as a relative file path. | 244 // Treat as a relative file path. |
| 245 FilePath path = FilePath(args[0]); | 245 FilePath path = FilePath(args[0]); |
| 246 file_util::AbsolutePath(&path); | 246 file_util::AbsolutePath(&path); |
| 247 starting_url = net::FilePathToFileURL(path); | 247 starting_url = net::FilePathToFileURL(path); |
| 248 } | 248 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 TestShell::ShutdownTestShell(); | 343 TestShell::ShutdownTestShell(); |
| 344 TestShell::CleanupLogging(); | 344 TestShell::CleanupLogging(); |
| 345 | 345 |
| 346 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 346 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 347 base::StatsTable::set_current(NULL); | 347 base::StatsTable::set_current(NULL); |
| 348 delete table; | 348 delete table; |
| 349 RemoveSharedMemoryFile(stats_filename); | 349 RemoveSharedMemoryFile(stats_filename); |
| 350 | 350 |
| 351 return 0; | 351 return 0; |
| 352 } | 352 } |
| OLD | NEW |