OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/event_recorder.h" | 8 #include "base/event_recorder.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 path = path.AppendASCII("index.html"); | 217 path = path.AppendASCII("index.html"); |
218 starting_url = net::FilePathToFileURL(path); | 218 starting_url = net::FilePathToFileURL(path); |
219 } | 219 } |
220 | 220 |
221 std::vector<std::wstring> loose_values = parsed_command_line.GetLooseValues(); | 221 std::vector<std::wstring> loose_values = parsed_command_line.GetLooseValues(); |
222 if (loose_values.size() > 0) { | 222 if (loose_values.size() > 0) { |
223 GURL url(WideToUTF16Hack(loose_values[0])); | 223 GURL url(WideToUTF16Hack(loose_values[0])); |
224 if (url.is_valid()) { | 224 if (url.is_valid()) { |
225 starting_url = url; | 225 starting_url = url; |
226 } else { | 226 } else { |
227 // Treat as a file path | 227 // Treat as a relative file path. |
228 starting_url = | 228 FilePath path = FilePath::FromWStringHack(loose_values[0]); |
229 net::FilePathToFileURL(FilePath::FromWStringHack(loose_values[0])); | 229 file_util::AbsolutePath(&path); |
Elliot Glaysher
2010/04/29 19:54:39
Considering that you're doing this for convenience
| |
230 starting_url = net::FilePathToFileURL(path); | |
230 } | 231 } |
231 } | 232 } |
232 | 233 |
233 std::wstring js_flags = | 234 std::wstring js_flags = |
234 parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags); | 235 parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags); |
235 // Test shell always exposes the GC. | 236 // Test shell always exposes the GC. |
236 js_flags += L" --expose-gc"; | 237 js_flags += L" --expose-gc"; |
237 webkit_glue::SetJavaScriptFlags(js_flags); | 238 webkit_glue::SetJavaScriptFlags(js_flags); |
238 // Expose GCController to JavaScript. | 239 // Expose GCController to JavaScript. |
239 WebScriptController::registerExtension(extensions_v8::GCExtension::Get()); | 240 WebScriptController::registerExtension(extensions_v8::GCExtension::Get()); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 TestShell::ShutdownTestShell(); | 381 TestShell::ShutdownTestShell(); |
381 TestShell::CleanupLogging(); | 382 TestShell::CleanupLogging(); |
382 | 383 |
383 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 384 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
384 StatsTable::set_current(NULL); | 385 StatsTable::set_current(NULL); |
385 delete table; | 386 delete table; |
386 RemoveSharedMemoryFile(stats_filename); | 387 RemoveSharedMemoryFile(stats_filename); |
387 | 388 |
388 return 0; | 389 return 0; |
389 } | 390 } |
OLD | NEW |