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 "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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // otherwise they'll try to use unit_test.exe. | 117 // otherwise they'll try to use unit_test.exe. |
118 std::wstring subprocess_path; | 118 std::wstring subprocess_path; |
119 PathService::Get(base::FILE_EXE, &subprocess_path); | 119 PathService::Get(base::FILE_EXE, &subprocess_path); |
120 FilePath fp_subprocess_path = FilePath::FromWStringHack(subprocess_path); | 120 FilePath fp_subprocess_path = FilePath::FromWStringHack(subprocess_path); |
121 subprocess_path = fp_subprocess_path.DirName().ToWStringHack(); | 121 subprocess_path = fp_subprocess_path.DirName().ToWStringHack(); |
122 file_util::AppendToPath(&subprocess_path, | 122 file_util::AppendToPath(&subprocess_path, |
123 chrome::kBrowserProcessExecutablePath); | 123 chrome::kBrowserProcessExecutablePath); |
124 command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath, | 124 command_line->AppendSwitchWithValue(switches::kBrowserSubprocessPath, |
125 subprocess_path); | 125 subprocess_path); |
126 | 126 |
| 127 // Enable warning level logging so that we can see when bad stuff happens. |
| 128 command_line->AppendSwitch(switches::kEnableLogging); |
| 129 command_line->AppendSwitchWithValue(switches::kLoggingLevel, |
| 130 IntToWString(1)); // warning |
| 131 |
127 SandboxInitWrapper sandbox_wrapper; | 132 SandboxInitWrapper sandbox_wrapper; |
128 MainFunctionParams params(*command_line, sandbox_wrapper, NULL); | 133 MainFunctionParams params(*command_line, sandbox_wrapper, NULL); |
129 params.ui_task = | 134 params.ui_task = |
130 NewRunnableMethod(this, &InProcessBrowserTest::RunTestOnMainThreadLoop); | 135 NewRunnableMethod(this, &InProcessBrowserTest::RunTestOnMainThreadLoop); |
131 | 136 |
132 scoped_refptr<net::RuleBasedHostMapper> host_mapper( | 137 scoped_refptr<net::RuleBasedHostMapper> host_mapper( |
133 new net::RuleBasedHostMapper()); | 138 new net::RuleBasedHostMapper()); |
134 ConfigureHostMapper(host_mapper.get()); | 139 ConfigureHostMapper(host_mapper.get()); |
135 net::ScopedHostMapper scoped_host_mapper(host_mapper.get()); | 140 net::ScopedHostMapper scoped_host_mapper(host_mapper.get()); |
136 BrowserMain(params); | 141 BrowserMain(params); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 248 |
244 GTEST_NONFATAL_FAILURE_("Timed-out"); | 249 GTEST_NONFATAL_FAILURE_("Timed-out"); |
245 | 250 |
246 // Start the timeout timer to prevent hangs. | 251 // Start the timeout timer to prevent hangs. |
247 MessageLoopForUI::current()->PostDelayedTask(FROM_HERE, | 252 MessageLoopForUI::current()->PostDelayedTask(FROM_HERE, |
248 NewRunnableMethod(this, &InProcessBrowserTest::TimedOut), | 253 NewRunnableMethod(this, &InProcessBrowserTest::TimedOut), |
249 kSubsequentTimeoutInMS); | 254 kSubsequentTimeoutInMS); |
250 | 255 |
251 MessageLoopForUI::current()->Quit(); | 256 MessageLoopForUI::current()->Quit(); |
252 } | 257 } |
OLD | NEW |