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 "app/app_switches.h" | |
8 #include "app/gfx/gl/gl_implementation.h" | |
9 #include "base/command_line.h" | 7 #include "base/command_line.h" |
10 #include "base/file_path.h" | 8 #include "base/file_path.h" |
11 #include "base/file_util.h" | 9 #include "base/file_util.h" |
12 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
13 #include "base/path_service.h" | 11 #include "base/path_service.h" |
14 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
15 #include "base/test/test_file_util.h" | 13 #include "base/test/test_file_util.h" |
16 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
17 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
18 #include "chrome/browser/browser_navigator.h" | 16 #include "chrome/browser/browser_navigator.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (!command_line->HasSwitch(kUnitTestShowWindows) && !show_window_) | 144 if (!command_line->HasSwitch(kUnitTestShowWindows) && !show_window_) |
147 BrowserView::SetShowState(SW_HIDE); | 145 BrowserView::SetShowState(SW_HIDE); |
148 #endif | 146 #endif |
149 | 147 |
150 if (dom_automation_enabled_) | 148 if (dom_automation_enabled_) |
151 command_line->AppendSwitch(switches::kDomAutomationController); | 149 command_line->AppendSwitch(switches::kDomAutomationController); |
152 | 150 |
153 // This is a Browser test. | 151 // This is a Browser test. |
154 command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); | 152 command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); |
155 | 153 |
156 // Force tests to use OSMesa if they launch the GPU process. | |
157 command_line->AppendSwitchASCII(switches::kUseGL, | |
158 gfx::kGLImplementationOSMesaName); | |
159 | |
160 // Mac does not support accelerated compositing with OSMesa. Disable on all | |
161 // platforms so it is consistent. http://crbug.com/58343 | |
162 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | |
163 | |
164 // Single-process mode is not set in BrowserMain so it needs to be processed | 154 // Single-process mode is not set in BrowserMain so it needs to be processed |
165 // explicitly. | 155 // explicitly. |
166 original_single_process_ = RenderProcessHost::run_renderer_in_process(); | 156 original_single_process_ = RenderProcessHost::run_renderer_in_process(); |
167 if (command_line->HasSwitch(switches::kSingleProcess)) | 157 if (command_line->HasSwitch(switches::kSingleProcess)) |
168 RenderProcessHost::set_run_renderer_in_process(true); | 158 RenderProcessHost::set_run_renderer_in_process(true); |
169 | 159 |
170 #if defined(OS_WIN) | 160 #if defined(OS_WIN) |
171 // The Windows sandbox requires that the browser and child processes are the | 161 // The Windows sandbox requires that the browser and child processes are the |
172 // same binary. So we launch browser_process.exe which loads chrome.dll | 162 // same binary. So we launch browser_process.exe which loads chrome.dll |
173 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, | 163 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 return; | 365 return; |
376 | 366 |
377 // Invoke CloseAllBrowsersAndExit on a running message loop. | 367 // Invoke CloseAllBrowsersAndExit on a running message loop. |
378 // CloseAllBrowsersAndExit exits the message loop after everything has been | 368 // CloseAllBrowsersAndExit exits the message loop after everything has been |
379 // shut down properly. | 369 // shut down properly. |
380 MessageLoopForUI::current()->PostTask( | 370 MessageLoopForUI::current()->PostTask( |
381 FROM_HERE, | 371 FROM_HERE, |
382 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); | 372 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); |
383 ui_test_utils::RunMessageLoop(); | 373 ui_test_utils::RunMessageLoop(); |
384 } | 374 } |
OLD | NEW |