summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authorhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 18:29:54 +0000
committerhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 18:29:54 +0000
commit616d628496d7940cecfe5b42a73215cbbbff9f1d (patch)
tree9e4b8f796ba3dc2cddac5b26e4fda08afa365ef7 /webkit/tools
parent67f862cc663a20ee7f7b21d72b1717ce02796452 (diff)
downloadchromium_src-616d628496d7940cecfe5b42a73215cbbbff9f1d.zip
chromium_src-616d628496d7940cecfe5b42a73215cbbbff9f1d.tar.gz
chromium_src-616d628496d7940cecfe5b42a73215cbbbff9f1d.tar.bz2
Suppress Gtk warnings like
(test_shell:2476): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/immodules/im-uim.so: wrong ELF class: ELFCLASS64 (test_shell:2476): Gtk-WARNING **: Loading IM context type 'uim' failed This happens when Gtk tries to open 64 bit shared object from 32 bit binaries. As this change suppress warnings only when the above three lines come the same order, we can still see other important warnings. Review URL: http://codereview.chromium.org/115263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc b/webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc
index 78dd552..4947b01 100644
--- a/webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc
@@ -9,8 +9,35 @@
#include "webkit/tools/test_shell/test_shell.h"
#include "webkit/tools/test_shell/test_shell_platform_delegate.h"
+// Hooks Gtk's logs so that we can ignore harmless warnings.
+static void GtkLogHandler(const gchar* log_domain,
+ GLogLevelFlags log_level,
+ const gchar* message,
+ gpointer userdata) {
+ if (strstr(message, "Loading IM context type") ||
+ strstr(message, "wrong ELF class: ELFCLASS64")) {
+ // GTK outputs some warnings when it attempts to load 64bit shared
+ // objects from 32bit binaries. Suppress them as they are not
+ // actual errors. The warning messages are like
+ //
+ // (test_shell:2476): Gtk-WARNING **:
+ // /usr/lib/gtk-2.0/2.10.0/immodules/im-uim.so: wrong ELF class: ELFCLASS64
+ //
+ // (test_shell:2476): Gtk-WARNING **: Loading IM context type 'uim' failed
+ //
+ // Related bug: http://crbug.com/9643
+ } else {
+ g_log_default_handler(log_domain, log_level, message, userdata);
+ }
+}
+
+static void SetUpGtkLogHandler() {
+ g_log_set_handler("Gtk", G_LOG_LEVEL_WARNING, GtkLogHandler, NULL);
+}
+
void TestShellPlatformDelegate::PreflightArgs(int *argc, char ***argv) {
gtk_init(argc, argv);
+ SetUpGtkLogHandler();
}
void TestShellPlatformDelegate::SelectUnifiedTheme() {