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