Chromium Code Reviews| 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 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 | 7 |
| 8 #include <stdlib.h> // required by _set_abort_behavior | 8 #include <stdlib.h> // required by _set_abort_behavior |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 TestShell::InitializeTestShell(layout_test_mode); | 225 TestShell::InitializeTestShell(layout_test_mode); |
| 226 | 226 |
| 227 if (parsed_command_line.HasSwitch(test_shell::kAllowScriptsToCloseWindows)) | 227 if (parsed_command_line.HasSwitch(test_shell::kAllowScriptsToCloseWindows)) |
| 228 TestShell::SetAllowScriptsToCloseWindows(); | 228 TestShell::SetAllowScriptsToCloseWindows(); |
| 229 | 229 |
| 230 // Disable user themes for layout tests so pixel tests are consistent. | 230 // Disable user themes for layout tests so pixel tests are consistent. |
| 231 if (layout_test_mode) { | 231 if (layout_test_mode) { |
| 232 #if defined(OS_WIN) | 232 #if defined(OS_WIN) |
| 233 gfx::NativeTheme::instance()->DisableTheming(); | 233 gfx::NativeTheme::instance()->DisableTheming(); |
| 234 #elif defined(OS_LINUX) | 234 #elif defined(OS_LINUX) |
| 235 // Stop custom gtkrc files from messing with the theme. | |
| 236 gchar *default_gtkrc_files[] = { NULL }; | |
|
Evan Martin
2009/01/24 01:39:20
star on the left (gchar* default...)
| |
| 237 gtk_rc_set_default_files(default_gtkrc_files); | |
| 238 gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE); | |
| 239 | |
| 235 // Pick a theme that uses Cairo for drawing, since we: | 240 // Pick a theme that uses Cairo for drawing, since we: |
| 236 // 1) currently don't support GTK themes that use the GDK drawing APIs, and | 241 // 1) currently don't support GTK themes that use the GDK drawing APIs, and |
| 237 // 2) need to use a unified theme for layout tests anyway. | 242 // 2) need to use a unified theme for layout tests anyway. |
| 238 g_object_set(gtk_settings_get_default(), | 243 g_object_set(gtk_settings_get_default(), |
| 239 "gtk-theme-name", "Mist", | 244 "gtk-theme-name", "Mist", |
| 240 NULL); | 245 NULL); |
| 241 #endif | 246 #endif |
| 242 } | 247 } |
| 243 | 248 |
| 244 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { | 249 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 | 400 |
| 396 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 401 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 397 StatsTable::set_current(NULL); | 402 StatsTable::set_current(NULL); |
| 398 delete table; | 403 delete table; |
| 399 | 404 |
| 400 #ifdef _CRTDBG_MAP_ALLOC | 405 #ifdef _CRTDBG_MAP_ALLOC |
| 401 _CrtDumpMemoryLeaks(); | 406 _CrtDumpMemoryLeaks(); |
| 402 #endif | 407 #endif |
| 403 return 0; | 408 return 0; |
| 404 } | 409 } |
| OLD | NEW |