| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/app_switches.h" | 5 #include "app/app_switches.h" |
| 6 #include "app/gfx/gl/gl_implementation.h" | 6 #include "app/gfx/gl/gl_implementation.h" |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Treat the first argument as the initial URL to open. | 234 // Treat the first argument as the initial URL to open. |
| 235 GURL starting_url; | 235 GURL starting_url; |
| 236 | 236 |
| 237 FilePath path; | 237 FilePath path; |
| 238 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 238 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 239 path = path.AppendASCII("webkit").AppendASCII("data") | 239 path = path.AppendASCII("webkit").AppendASCII("data") |
| 240 .AppendASCII("test_shell").AppendASCII("index.html"); | 240 .AppendASCII("test_shell").AppendASCII("index.html"); |
| 241 starting_url = net::FilePathToFileURL(path); | 241 starting_url = net::FilePathToFileURL(path); |
| 242 | 242 |
| 243 const std::vector<CommandLine::StringType>& args = parsed_command_line.args(); | 243 const std::vector<CommandLine::StringType>& args = parsed_command_line.args(); |
| 244 if (args.size() > 0) { | 244 if (!args.empty()) { |
| 245 GURL url(args[0]); | 245 GURL url(args[0]); |
| 246 if (url.is_valid()) { | 246 if (url.is_valid()) { |
| 247 starting_url = url; | 247 starting_url = url; |
| 248 } else { | 248 } else { |
| 249 // Treat as a relative file path. | 249 // Treat as a relative file path. |
| 250 FilePath path = FilePath(args[0]); | 250 FilePath path = FilePath(args[0]); |
| 251 file_util::AbsolutePath(&path); | 251 file_util::AbsolutePath(&path); |
| 252 starting_url = net::FilePathToFileURL(path); | 252 starting_url = net::FilePathToFileURL(path); |
| 253 } | 253 } |
| 254 } | 254 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 TestShell::ShutdownTestShell(); | 348 TestShell::ShutdownTestShell(); |
| 349 TestShell::CleanupLogging(); | 349 TestShell::CleanupLogging(); |
| 350 | 350 |
| 351 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 351 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 352 base::StatsTable::set_current(NULL); | 352 base::StatsTable::set_current(NULL); |
| 353 delete table; | 353 delete table; |
| 354 RemoveSharedMemoryFile(stats_filename); | 354 RemoveSharedMemoryFile(stats_filename); |
| 355 | 355 |
| 356 return 0; | 356 return 0; |
| 357 } | 357 } |
| OLD | NEW |