filechooserbutton: In the tests, run through the dialog more than one time
This ensures that data maintained by the button while the dialog opens/closes remains consistent. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This commit is contained in:
@ -382,6 +382,8 @@ test_file_chooser_button (gconstpointer data)
|
|||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
GtkWidget *fc_button;
|
GtkWidget *fc_button;
|
||||||
GtkWidget *fc_dialog;
|
GtkWidget *fc_dialog;
|
||||||
|
int iterations;
|
||||||
|
int i;
|
||||||
|
|
||||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
@ -398,6 +400,17 @@ test_file_chooser_button (gconstpointer data)
|
|||||||
gtk_widget_show_all (window);
|
gtk_widget_show_all (window);
|
||||||
wait_for_idle ();
|
wait_for_idle ();
|
||||||
|
|
||||||
|
/* If there is a dialog to be opened, we actually test going through it a
|
||||||
|
* couple of times. This ensures that any state that the button frobs for
|
||||||
|
* each appearance of the dialog will make sense.
|
||||||
|
*/
|
||||||
|
if (setup->open_dialog)
|
||||||
|
iterations = 2;
|
||||||
|
else
|
||||||
|
iterations = 1;
|
||||||
|
|
||||||
|
for (i = 0; i < iterations; i++)
|
||||||
|
{
|
||||||
if (setup->open_dialog)
|
if (setup->open_dialog)
|
||||||
{
|
{
|
||||||
GList *children;
|
GList *children;
|
||||||
@ -447,6 +460,7 @@ test_file_chooser_button (gconstpointer data)
|
|||||||
g_assert_cmpstr (filename, ==, setup->final_filename);
|
g_assert_cmpstr (filename, ==, setup->final_filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gtk_widget_destroy (window);
|
gtk_widget_destroy (window);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user