| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <stdlib.h> // required by _set_abort_behavior | 5 #include <stdlib.h> // required by _set_abort_behavior |
| 6 #include <gtk/gtk.h> | 6 #include <gtk/gtk.h> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "webkit/tools/test_shell/test_shell.h" | 9 #include "webkit/tools/test_shell/test_shell.h" |
| 10 #include "webkit/tools/test_shell/test_shell_platform_delegate.h" | 10 #include "webkit/tools/test_shell/test_shell_platform_delegate.h" |
| 11 | 11 |
| 12 void TestShellPlatformDelegate::PreflightArgs(int *argc, char ***argv) { | 12 void TestShellPlatformDelegate::PreflightArgs(int *argc, char ***argv) { |
| 13 gtk_init(argc, argv); | 13 gtk_init(argc, argv); |
| 14 } | 14 } |
| 15 | 15 |
| 16 void TestShellPlatformDelegate::SelectUnifiedTheme() { | 16 void TestShellPlatformDelegate::SelectUnifiedTheme() { |
| 17 // Stop custom gtkrc files from messing with the theme. |
| 18 gchar* default_gtkrc_files[] = { NULL }; |
| 19 gtk_rc_set_default_files(default_gtkrc_files); |
| 20 gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE); |
| 21 |
| 17 // Pick a theme that uses Cairo for drawing, since we: | 22 // Pick a theme that uses Cairo for drawing, since we: |
| 18 // 1) currently don't support GTK themes that use the GDK drawing APIs, and | 23 // 1) currently don't support GTK themes that use the GDK drawing APIs, and |
| 19 // 2) need to use a unified theme for layout tests anyway. | 24 // 2) need to use a unified theme for layout tests anyway. |
| 20 g_object_set(gtk_settings_get_default(), | 25 g_object_set(gtk_settings_get_default(), |
| 21 "gtk-theme-name", "Mist", | 26 "gtk-theme-name", "Mist", |
| 22 NULL); | 27 NULL); |
| 23 } | 28 } |
| 24 | 29 |
| 25 TestShellPlatformDelegate::TestShellPlatformDelegate( | 30 TestShellPlatformDelegate::TestShellPlatformDelegate( |
| 26 const CommandLine& command_line) | 31 const CommandLine& command_line) |
| 27 : command_line_(command_line) { | 32 : command_line_(command_line) { |
| 28 } | 33 } |
| 29 | 34 |
| 30 bool TestShellPlatformDelegate::CheckLayoutTestSystemDependencies() { | 35 bool TestShellPlatformDelegate::CheckLayoutTestSystemDependencies() { |
| 31 return true; | 36 return true; |
| 32 } | 37 } |
| 33 | 38 |
| 34 void TestShellPlatformDelegate::SuppressErrorReporting() { | 39 void TestShellPlatformDelegate::SuppressErrorReporting() { |
| 35 } | 40 } |
| 36 | 41 |
| 37 void TestShellPlatformDelegate::InitializeGUI() { | 42 void TestShellPlatformDelegate::InitializeGUI() { |
| 38 } | 43 } |
| 39 | 44 |
| 40 void TestShellPlatformDelegate::SetWindowPositionForRecording(TestShell *) { | 45 void TestShellPlatformDelegate::SetWindowPositionForRecording(TestShell *) { |
| 41 } | 46 } |
| 42 | 47 |
| 43 TestShellPlatformDelegate::~TestShellPlatformDelegate() { | 48 TestShellPlatformDelegate::~TestShellPlatformDelegate() { |
| 44 } | 49 } |
| OLD | NEW |