[Xfce4-commits] <midori:master> Fix test issues due to unset settings, version, session

Christian Dywan noreply at xfce.org
Tue Nov 8 22:44:03 CET 2011


Updating branch refs/heads/master
         to eb205d53d4139fcda966ad750e8270077a448874 (commit)
       from 4cb498940d4255cbd72d6abfa31f9ae178d61a2c (commit)

commit eb205d53d4139fcda966ad750e8270077a448874
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Nov 8 21:57:50 2011 +0100

    Fix test issues due to unset settings, version, session

 midori/midori-extension.c |    4 ++--
 tests/extensions.c        |    1 +
 tests/properties.c        |    2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/midori/midori-extension.c b/midori/midori-extension.c
index d4244b9..7927e72 100644
--- a/midori/midori-extension.c
+++ b/midori/midori-extension.c
@@ -428,12 +428,12 @@ midori_extension_set_property (GObject*      object,
     {
         /* Don't show version suffix if it matches the running Midori */
         const gchar* version = g_value_get_string (value);
-        if (g_str_has_suffix (version, MIDORI_VERSION_SUFFIX))
+        if (version && g_str_has_suffix (version, MIDORI_VERSION_SUFFIX))
             katze_assign (extension->priv->version,
                 g_strndup (version,
                            strlen (version) - strlen (MIDORI_VERSION_SUFFIX)));
         /* No version suffix at all, must be 0.4.1 or 0.4.1 git */
-        else if (!strchr (version, '-') && !strchr (version, '('))
+        else if (version && !strchr (version, '-') && !strchr (version, '('))
             katze_assign (extension->priv->version,
                 g_strconcat (version, " (0.4.1)", NULL));
         else
diff --git a/tests/extensions.c b/tests/extensions.c
index 911ebf0..16a4848 100644
--- a/tests/extensions.c
+++ b/tests/extensions.c
@@ -168,6 +168,7 @@ extension_activate (gconstpointer data)
 {
     MidoriApp* app = midori_app_new ();
     MidoriExtension* extension = MIDORI_EXTENSION (data);
+    g_object_set (app, "settings", midori_web_settings_new (), NULL);
     g_signal_emit_by_name (extension, "activate", app);
     midori_extension_deactivate (extension);
     g_object_unref (app);
diff --git a/tests/properties.c b/tests/properties.c
index cd6b61c..05c1358 100644
--- a/tests/properties.c
+++ b/tests/properties.c
@@ -189,6 +189,8 @@ main (int    argc,
       char** argv)
 {
     midori_app_setup (argv);
+    g_object_set_data (G_OBJECT (webkit_get_default_session ()),
+                       "midori-session-initialized", (void*)1);
     g_test_init (&argc, &argv, NULL);
     gtk_init_check (&argc, &argv);
 


More information about the Xfce4-commits mailing list