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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (!(test_url.is_valid() && test_url.has_scheme())) { | 66 if (!(test_url.is_valid() && test_url.has_scheme())) { |
67 // 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. |
68 base::ThreadRestrictions::ScopedAllowIO allow_io; | 68 base::ThreadRestrictions::ScopedAllowIO allow_io; |
69 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
70 std::wstring wide_path_or_url = | 70 std::wstring wide_path_or_url = |
71 base::SysNativeMBToWide(path_or_url); | 71 base::SysNativeMBToWide(path_or_url); |
72 base::FilePath local_file(wide_path_or_url); | 72 base::FilePath local_file(wide_path_or_url); |
73 #else | 73 #else |
74 base::FilePath local_file(path_or_url); | 74 base::FilePath local_file(path_or_url); |
75 #endif | 75 #endif |
76 if (!file_util::PathExists(local_file)) { | 76 if (!base::PathExists(local_file)) { |
77 local_file = content::GetWebKitRootDirFilePath() | 77 local_file = content::GetWebKitRootDirFilePath() |
78 .Append(FILE_PATH_LITERAL("LayoutTests")).Append(local_file); | 78 .Append(FILE_PATH_LITERAL("LayoutTests")).Append(local_file); |
79 } | 79 } |
80 test_url = net::FilePathToFileURL(base::MakeAbsoluteFilePath(local_file)); | 80 test_url = net::FilePathToFileURL(base::MakeAbsoluteFilePath(local_file)); |
81 } | 81 } |
82 base::FilePath local_path; | 82 base::FilePath local_path; |
83 if (current_working_directory) { | 83 if (current_working_directory) { |
84 // We're outside of the message loop here, and this is a test. | 84 // We're outside of the message loop here, and this is a test. |
85 base::ThreadRestrictions::ScopedAllowIO allow_io; | 85 base::ThreadRestrictions::ScopedAllowIO allow_io; |
86 if (net::FileURLToFilePath(test_url, &local_path)) | 86 if (net::FileURLToFilePath(test_url, &local_path)) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 #if !defined(OS_ANDROID) | 206 #if !defined(OS_ANDROID) |
207 if (!layout_test_mode) | 207 if (!layout_test_mode) |
208 exit_code = main_runner->Run(); | 208 exit_code = main_runner->Run(); |
209 | 209 |
210 main_runner->Shutdown(); | 210 main_runner->Shutdown(); |
211 #endif | 211 #endif |
212 | 212 |
213 return exit_code; | 213 return exit_code; |
214 } | 214 } |
OLD | NEW |