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 "chrome/test/in_process_browser_test.h" | 5 #include "chrome/test/in_process_browser_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, | 159 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, |
160 command_line->GetProgram()); | 160 command_line->GetProgram()); |
161 #else | 161 #else |
162 // Explicitly set the path of the binary used for child processes, otherwise | 162 // Explicitly set the path of the binary used for child processes, otherwise |
163 // they'll try to use browser_tests which doesn't contain ChromeMain. | 163 // they'll try to use browser_tests which doesn't contain ChromeMain. |
164 FilePath subprocess_path; | 164 FilePath subprocess_path; |
165 PathService::Get(base::FILE_EXE, &subprocess_path); | 165 PathService::Get(base::FILE_EXE, &subprocess_path); |
166 subprocess_path = subprocess_path.DirName(); | 166 subprocess_path = subprocess_path.DirName(); |
167 subprocess_path = subprocess_path.AppendASCII(WideToASCII( | 167 subprocess_path = subprocess_path.AppendASCII(WideToASCII( |
168 chrome::kBrowserProcessExecutablePath)); | 168 chrome::kBrowserProcessExecutablePath)); |
| 169 #if defined(OS_MACOSX) |
| 170 // Recreate the real environment, run the helper within the app bundle. |
| 171 subprocess_path = subprocess_path.DirName().DirName(); |
| 172 DCHECK_EQ(subprocess_path.BaseName().value(), "Contents"); |
| 173 subprocess_path = |
| 174 subprocess_path.Append("Versions").Append(chrome::kChromeVersion); |
| 175 subprocess_path = |
| 176 subprocess_path.Append(chrome::kHelperProcessExecutablePath); |
| 177 #endif |
169 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, | 178 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, |
170 subprocess_path); | 179 subprocess_path); |
171 #endif | 180 #endif |
172 | 181 |
173 // Enable warning level logging so that we can see when bad stuff happens. | 182 // Enable warning level logging so that we can see when bad stuff happens. |
174 command_line->AppendSwitch(switches::kEnableLogging); | 183 command_line->AppendSwitch(switches::kEnableLogging); |
175 command_line->AppendSwitchASCII(switches::kLoggingLevel, "1"); // warning | 184 command_line->AppendSwitchASCII(switches::kLoggingLevel, "1"); // warning |
176 | 185 |
177 // If ncecessary, disable TabCloseableStateWatcher. | 186 // If ncecessary, disable TabCloseableStateWatcher. |
178 if (!tab_closeable_state_watcher_enabled_) | 187 if (!tab_closeable_state_watcher_enabled_) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 MessageLoopForUI::current()->Quit(); | 339 MessageLoopForUI::current()->Quit(); |
331 | 340 |
332 // WARNING: This must be after Quit as it returns. | 341 // WARNING: This must be after Quit as it returns. |
333 FAIL() << error_message; | 342 FAIL() << error_message; |
334 } | 343 } |
335 | 344 |
336 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { | 345 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { |
337 DCHECK_GT(timeout_value, 0); | 346 DCHECK_GT(timeout_value, 0); |
338 initial_timeout_ = timeout_value; | 347 initial_timeout_ = timeout_value; |
339 } | 348 } |
OLD | NEW |