| OLD | NEW |
| 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 "content/shell/shell_browser_main.h" | 5 #include "content/shell/shell_browser_main.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (!(test_url.is_valid() && test_url.has_scheme())) { | 53 if (!(test_url.is_valid() && test_url.has_scheme())) { |
| 54 // We're outside of the message loop here, and this is a test. | 54 // We're outside of the message loop here, and this is a test. |
| 55 base::ThreadRestrictions::ScopedAllowIO allow_io; | 55 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 57 std::wstring wide_path_or_url = | 57 std::wstring wide_path_or_url = |
| 58 base::SysNativeMBToWide(path_or_url); | 58 base::SysNativeMBToWide(path_or_url); |
| 59 base::FilePath local_file(wide_path_or_url); | 59 base::FilePath local_file(wide_path_or_url); |
| 60 #else | 60 #else |
| 61 base::FilePath local_file(path_or_url); | 61 base::FilePath local_file(path_or_url); |
| 62 #endif | 62 #endif |
| 63 file_util::AbsolutePath(&local_file); | 63 test_url = net::FilePathToFileURL(base::MakeAbsoluteFilePath(local_file)); |
| 64 test_url = net::FilePathToFileURL(local_file); | |
| 65 } | 64 } |
| 66 base::FilePath local_path; | 65 base::FilePath local_path; |
| 67 if (current_working_directory) { | 66 if (current_working_directory) { |
| 68 // We're outside of the message loop here, and this is a test. | 67 // We're outside of the message loop here, and this is a test. |
| 69 base::ThreadRestrictions::ScopedAllowIO allow_io; | 68 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 70 if (net::FileURLToFilePath(test_url, &local_path)) | 69 if (net::FileURLToFilePath(test_url, &local_path)) |
| 71 *current_working_directory = local_path.DirName(); | 70 *current_working_directory = local_path.DirName(); |
| 72 else | 71 else |
| 73 file_util::GetCurrentDirectory(current_working_directory); | 72 file_util::GetCurrentDirectory(current_working_directory); |
| 74 } | 73 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 170 } |
| 172 exit_code = 0; | 171 exit_code = 0; |
| 173 } else { | 172 } else { |
| 174 exit_code = main_runner_->Run(); | 173 exit_code = main_runner_->Run(); |
| 175 } | 174 } |
| 176 | 175 |
| 177 main_runner_->Shutdown(); | 176 main_runner_->Shutdown(); |
| 178 | 177 |
| 179 return exit_code; | 178 return exit_code; |
| 180 } | 179 } |
| OLD | NEW |