From: Christian Dywan Date: Sun, 17 May 2009 14:55:02 +0000 (+0200) Subject: Adjust completion test after modifying the location entry X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=964bcd0c1c1978caf033c49ce0125aaeabb1fea5;p=midori Adjust completion test after modifying the location entry --- diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 37fc30d3..588f7171 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -189,7 +189,8 @@ midori_location_action_class_init (MidoriLocationActionClass* class) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } -static GtkWidget* +/* Allow this to be used in tests, it's otherwise private */ +/*static*/ GtkWidget* midori_location_action_entry_for_proxy (GtkWidget* proxy) { GtkWidget* alignment = gtk_bin_get_child (GTK_BIN (proxy)); diff --git a/tests/completion.c b/tests/completion.c index 86ddb5df..80ca112a 100644 --- a/tests/completion.c +++ b/tests/completion.c @@ -15,6 +15,10 @@ #include "midori.h" +/* This is a private function */ +GtkWidget* +midori_location_action_entry_for_proxy (GtkWidget* proxy); + typedef struct { const gchar* uri; @@ -41,7 +45,6 @@ completion_count (void) { MidoriLocationAction* action; GtkWidget* toolitem; - GtkWidget* alignment; GtkWidget* location_entry; GtkWidget* entry; GtkTreeModel* model; @@ -49,8 +52,7 @@ completion_count (void) action = g_object_new (MIDORI_TYPE_LOCATION_ACTION, NULL); toolitem = gtk_action_create_tool_item (GTK_ACTION (action)); - alignment = gtk_bin_get_child (GTK_BIN (toolitem)); - location_entry = gtk_bin_get_child (GTK_BIN (alignment)); + location_entry = midori_location_action_entry_for_proxy (toolitem); entry = gtk_bin_get_child (GTK_BIN (location_entry)); model = gtk_combo_box_get_model (GTK_COMBO_BOX (location_entry)); @@ -129,7 +131,6 @@ completion_fill (void) { MidoriLocationAction* action; GtkWidget* toolitem; - GtkWidget* alignment; GtkWidget* location_entry; GtkWidget* entry; GtkTreeModel* model; @@ -138,8 +139,7 @@ completion_fill (void) action = g_object_new (MIDORI_TYPE_LOCATION_ACTION, NULL); toolitem = gtk_action_create_tool_item (GTK_ACTION (action)); - alignment = gtk_bin_get_child (GTK_BIN (toolitem)); - location_entry = gtk_bin_get_child (GTK_BIN (alignment)); + location_entry = midori_location_action_entry_for_proxy (toolitem); entry = gtk_bin_get_child (GTK_BIN (location_entry)); g_print ("...\n"); @@ -217,7 +217,6 @@ completion_match (void) { MidoriLocationAction* action; GtkWidget* toolitem; - GtkWidget* alignment; GtkWidget* location_entry; GtkWidget* entry; GtkEntryCompletion* completion; @@ -230,8 +229,7 @@ completion_match (void) midori_location_action_thaw (action); toolitem = gtk_action_create_tool_item (GTK_ACTION (action)); - alignment = gtk_bin_get_child (GTK_BIN (toolitem)); - location_entry = gtk_bin_get_child (GTK_BIN (alignment)); + location_entry = midori_location_action_entry_for_proxy (toolitem); entry = gtk_bin_get_child (GTK_BIN (location_entry)); completion = gtk_entry_get_completion (GTK_ENTRY (entry)); g_signal_connect (completion, "insert-prefix",