[Xfce4-commits] <midori:master> Add generic log_set_fatal_handler_for_icons
Christian Dywan
noreply at xfce.org
Thu Dec 6 02:32:07 CET 2012
Updating branch refs/heads/master
to ee98880083d38e5a17337becbf7d9196d0c77313 (commit)
from fd8f02aca67988f62c0df7cc441025ed827300bc (commit)
commit ee98880083d38e5a17337becbf7d9196d0c77313
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Dec 6 02:29:43 2012 +0100
Add generic log_set_fatal_handler_for_icons
Tests should now pass w/o any theme or hicolor.
midori/midori-dialog.vala | 9 +++++++++
tests/app.vala | 11 +++--------
tests/browser.c | 13 +------------
tests/properties.c | 1 +
tests/tab.vala | 4 +---
5 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/midori/midori-dialog.vala b/midori/midori-dialog.vala
index 55b6bad..48d6405 100644
--- a/midori/midori-dialog.vala
+++ b/midori/midori-dialog.vala
@@ -11,6 +11,15 @@
namespace Midori {
namespace Test {
+ public void log_set_fatal_handler_for_icons () {
+ GLib.Test.log_set_fatal_handler ((domain, log_levels, message)=> {
+ return !message.contains ("Error loading theme icon")
+ && !message.contains ("Could not find the icon")
+ && !message.contains ("get_column_number: assertion `i < gtk_tree_view_get_n_columns (treeview)' failed");
+ });
+
+ }
+
internal static Gtk.ResponseType test_response = Gtk.ResponseType.NONE;
public void set_dialog_response (Gtk.ResponseType response) {
test_response = response;
diff --git a/tests/app.vala b/tests/app.vala
index cfb747f..ea6a645 100644
--- a/tests/app.vala
+++ b/tests/app.vala
@@ -10,10 +10,7 @@
*/
void app_normal () {
- Test.log_set_fatal_handler ((domain, log_levels, message)=> {
- return !message.contains("Error loading theme icon");
- });
-
+ Midori.Test.log_set_fatal_handler_for_icons ();
Midori.Paths.Test.reset_runtime_mode ();
var app = Midori.normal_app_new (null, false, false, null, null, null, -1, null);
var loop = MainContext.default ();
@@ -25,11 +22,8 @@ void app_normal () {
}
void app_custom_config () {
+ Midori.Test.log_set_fatal_handler_for_icons ();
/*
- Test.log_set_fatal_handler ((domain, log_levels, message)=> {
- return !message.contains("Error loading theme icon");
- });
-
Midori.Paths.Test.reset_runtime_mode ();
var app = Midori.normal_app_new ("/tmp/mylittlepony", false, false, null, null, null, -1, null);
var loop = MainContext.default ();
@@ -38,6 +32,7 @@ void app_custom_config () {
*/
}
void app_private () {
+ Midori.Test.log_set_fatal_handler_for_icons ();
Midori.Paths.Test.reset_runtime_mode ();
Midori.private_app_new (null, null, null, null, -1, null);
var loop = MainContext.default ();
diff --git a/tests/browser.c b/tests/browser.c
index 3c53490..0cd4c51 100644
--- a/tests/browser.c
+++ b/tests/browser.c
@@ -11,17 +11,6 @@
#include "midori.h"
-static gboolean
-skip_gtk_bugs (const gchar* log_domain,
- GLogLevelFlags log_level,
- const gchar* message,
- gpointer user_data)
-{
- if (!strcmp (message, "get_column_number: assertion `i < gtk_tree_view_get_n_columns (treeview)' failed"))
- return FALSE;
- return TRUE;
-}
-
static void
browser_create (void)
{
@@ -37,7 +26,7 @@ browser_create (void)
gchar* filename;
gchar* filename2;
- g_test_log_set_fatal_handler (skip_gtk_bugs, NULL);
+ midori_test_log_set_fatal_handler_for_icons ();
app = midori_app_new ();
settings = midori_web_settings_new ();
diff --git a/tests/properties.c b/tests/properties.c
index 0cbe073..5434d1d 100644
--- a/tests/properties.c
+++ b/tests/properties.c
@@ -63,6 +63,7 @@ properties_type_test (gconstpointer type)
{
GObject* object;
+ midori_test_log_set_fatal_handler_for_icons ();
object = g_object_new ((GType)type, NULL);
properties_object_test ((gconstpointer)object);
}
diff --git a/tests/tab.vala b/tests/tab.vala
index a02864f..a4b6d20 100644
--- a/tests/tab.vala
+++ b/tests/tab.vala
@@ -76,9 +76,7 @@ static void tab_display_ellipsize () {
}
void tab_special () {
- Test.log_set_fatal_handler ((domain, log_levels, message)=> {
- return !message.contains("Error loading theme icon");
- });
+ Midori.Test.log_set_fatal_handler_for_icons ();
var test_address = new Soup.Address ("127.0.0.1", Soup.ADDRESS_ANY_PORT);
test_address.resolve_sync (null);
More information about the Xfce4-commits
mailing list