summaryrefslogtreecommitdiff
path: root/gtk/tests/filechooser.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2013-02-11 13:38:58 -0600
committerFederico Mena Quintero <federico@gnome.org>2013-02-13 18:01:39 -0600
commitba63578e626ed0c5f062c01aa47b4ac2438d54b3 (patch)
treea1c7dcbc9ee8866b96ca503936d6ffa41446552c /gtk/tests/filechooser.c
parent3472edb38dcc262772907322918995c0c56e4bbc (diff)
downloadgtk+-ba63578e626ed0c5f062c01aa47b4ac2438d54b3.tar.gz
filechooser: Get the filechooser tests to build
Some are ifdef-ed out with BROKEN_TESTS, but at least the tests will compile for now.
Diffstat (limited to 'gtk/tests/filechooser.c')
-rw-r--r--gtk/tests/filechooser.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gtk/tests/filechooser.c b/gtk/tests/filechooser.c
index 7341e66863..2537545b2a 100644
--- a/gtk/tests/filechooser.c
+++ b/gtk/tests/filechooser.c
@@ -494,7 +494,7 @@ get_impl_from_dialog (GtkWidget *dialog)
return impl;
}
-
+#ifdef BROKEN_TESTS
static gboolean
test_widgets_for_current_action (GtkFileChooserDialog *dialog,
GtkFileChooserAction expected_action)
@@ -659,7 +659,9 @@ test_action_widgets (void)
gtk_widget_destroy (dialog);
}
+#endif
+#ifdef BROKEN_TESTS
static gboolean
test_reload_sequence (gboolean set_folder_before_map)
{
@@ -815,6 +817,7 @@ test_reload (void)
log_test (passed, "test_reload(): set a folder explicitly before mapping");
g_assert (passed);
}
+#endif
static gboolean
test_button_folder_states_for_action (GtkFileChooserAction action, gboolean use_dialog, gboolean set_folder_on_dialog)
@@ -985,8 +988,8 @@ test_folder_switch_and_filters (void)
gboolean passed;
char *cwd;
char *base_dir;
- GtkFilePath *cwd_path;
- GtkFilePath *base_dir_path;
+ GFile *cwd_file;
+ GFile *base_dir_file;
GtkWidget *dialog;
GtkFileFilter *all_filter;
GtkFileFilter *txt_filter;
@@ -1003,8 +1006,8 @@ test_folder_switch_and_filters (void)
NULL);
impl = get_impl_from_dialog (dialog);
- cwd_path = gtk_file_system_filename_to_path (impl->file_system, cwd);
- base_dir_path = gtk_file_system_filename_to_path (impl->file_system, base_dir);
+ cwd_file = g_file_new_for_path (cwd);
+ base_dir_file = g_file_new_for_path (base_dir);
passed = passed && gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), base_dir);
g_assert (passed);
@@ -1046,8 +1049,8 @@ test_folder_switch_and_filters (void)
sleep_in_main_loop (0.25);
g_signal_emit_by_name (impl->browse_path_bar, "path-clicked",
- (GtkFilePath *) cwd_path,
- (GtkFilePath *) base_dir_path,
+ cwd_file,
+ base_dir_file,
FALSE);
sleep_in_main_loop (0.25);
passed = passed && (gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (dialog)) == txt_filter);
@@ -1057,8 +1060,8 @@ test_folder_switch_and_filters (void)
/* cleanups */
g_free (cwd);
g_free (base_dir);
- gtk_file_path_free (cwd_path);
- gtk_file_path_free (base_dir_path);
+ g_object_unref (cwd_file);
+ g_object_unref (base_dir_file);
gtk_widget_destroy (dialog);
@@ -1075,8 +1078,12 @@ main (int argc,
/* register tests */
g_test_add_func ("/GtkFileChooser/black_box", test_black_box);
g_test_add_func ("/GtkFileChooser/confirm_overwrite", test_confirm_overwrite);
+#ifdef BROKEN_TESTS
g_test_add_func ("/GtkFileChooser/action_widgets", test_action_widgets);
+#endif
+#ifdef BROKEN_TESTS
g_test_add_func ("/GtkFileChooser/reload", test_reload);
+#endif
g_test_add_func ("/GtkFileChooser/button_folder_states", test_button_folder_states);
g_test_add_func ("/GtkFileChooser/folder_switch_and_filters", test_folder_switch_and_filters);