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 // Creates an instance of the test_shell. | 5 // Creates an instance of the test_shell. |
6 | 6 |
7 #include <stdlib.h> // required by _set_abort_behavior | 7 #include <stdlib.h> // required by _set_abort_behavior |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <commctrl.h> | 10 #include <commctrl.h> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 INITCOMMONCONTROLSEX InitCtrlEx; | 189 INITCOMMONCONTROLSEX InitCtrlEx; |
190 | 190 |
191 InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); | 191 InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); |
192 InitCtrlEx.dwICC = ICC_STANDARD_CLASSES; | 192 InitCtrlEx.dwICC = ICC_STANDARD_CLASSES; |
193 InitCommonControlsEx(&InitCtrlEx); | 193 InitCommonControlsEx(&InitCtrlEx); |
194 | 194 |
195 bool interactive = !layout_test_mode; | 195 bool interactive = !layout_test_mode; |
196 TestShell::InitializeTestShell(interactive); | 196 TestShell::InitializeTestShell(interactive); |
197 | 197 |
| 198 if (parsed_command_line.HasSwitch(test_shell::kAllowScriptsToCloseWindows)) |
| 199 TestShell::SetAllowScriptsToCloseWindows(); |
| 200 |
198 // Disable user themes for layout tests so pixel tests are consistent. | 201 // Disable user themes for layout tests so pixel tests are consistent. |
199 if (!interactive) | 202 if (!interactive) |
200 gfx::NativeTheme::instance()->DisableTheming(); | 203 gfx::NativeTheme::instance()->DisableTheming(); |
201 | 204 |
202 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { | 205 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { |
203 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( | 206 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( |
204 test_shell::kTestShellTimeOut); | 207 test_shell::kTestShellTimeOut); |
205 int timeout_ms = static_cast<int>(StringToInt64(timeout_str.c_str())); | 208 int timeout_ms = static_cast<int>(StringToInt64(timeout_str.c_str())); |
206 if (timeout_ms > 0) | 209 if (timeout_ms > 0) |
207 TestShell::SetFileTestTimeout(timeout_ms); | 210 TestShell::SetFileTestTimeout(timeout_ms); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 StatsTable::set_current(NULL); | 346 StatsTable::set_current(NULL); |
344 delete table; | 347 delete table; |
345 | 348 |
346 #ifdef _CRTDBG_MAP_ALLOC | 349 #ifdef _CRTDBG_MAP_ALLOC |
347 _CrtDumpMemoryLeaks(); | 350 _CrtDumpMemoryLeaks(); |
348 #endif | 351 #endif |
349 return 0; | 352 return 0; |
350 } | 353 } |
351 | 354 |
352 | 355 |
OLD | NEW |