Fix test issues due to unset settings, version, session

This commit is contained in:
Christian Dywan 2011-11-08 21:57:50 +01:00
parent 4cb498940d
commit eb205d53d4
3 changed files with 5 additions and 2 deletions

View file

@ -428,12 +428,12 @@ midori_extension_set_property (GObject* object,
{ {
/* Don't show version suffix if it matches the running Midori */ /* Don't show version suffix if it matches the running Midori */
const gchar* version = g_value_get_string (value); 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, katze_assign (extension->priv->version,
g_strndup (version, g_strndup (version,
strlen (version) - strlen (MIDORI_VERSION_SUFFIX))); strlen (version) - strlen (MIDORI_VERSION_SUFFIX)));
/* No version suffix at all, must be 0.4.1 or 0.4.1 git */ /* 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, katze_assign (extension->priv->version,
g_strconcat (version, " (0.4.1)", NULL)); g_strconcat (version, " (0.4.1)", NULL));
else else

View file

@ -168,6 +168,7 @@ extension_activate (gconstpointer data)
{ {
MidoriApp* app = midori_app_new (); MidoriApp* app = midori_app_new ();
MidoriExtension* extension = MIDORI_EXTENSION (data); MidoriExtension* extension = MIDORI_EXTENSION (data);
g_object_set (app, "settings", midori_web_settings_new (), NULL);
g_signal_emit_by_name (extension, "activate", app); g_signal_emit_by_name (extension, "activate", app);
midori_extension_deactivate (extension); midori_extension_deactivate (extension);
g_object_unref (app); g_object_unref (app);

View file

@ -189,6 +189,8 @@ main (int argc,
char** argv) char** argv)
{ {
midori_app_setup (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); g_test_init (&argc, &argv, NULL);
gtk_init_check (&argc, &argv); gtk_init_check (&argc, &argv);