summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-18 14:35:48 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-18 15:07:19 -0400
commit2b29ab5699e2b9c5c12efdea8d3719441377b98b (patch)
tree51e6f14b13aa731c1cf3ec4cf9da29d79b232f93 /test
parenta36dc6aefac077354fbea2145e9e5a61c46ce740 (diff)
downloadnautilus-2b29ab5699e2b9c5c12efdea8d3719441377b98b.tar.gz
test-search-engine: test cancellation and NautilusSearchEngineModel
Add some code in the search engine test to verify cancellation and NautilusSearchEngine model work properly.
Diffstat (limited to 'test')
-rw-r--r--test/test-nautilus-search-engine.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/test-nautilus-search-engine.c b/test/test-nautilus-search-engine.c
index d0d4f976c..d7270350d 100644
--- a/test/test-nautilus-search-engine.c
+++ b/test/test-nautilus-search-engine.c
@@ -16,14 +16,17 @@ static void
finished_cb (NautilusSearchEngine *engine)
{
g_print ("finished!\n");
-// gtk_main_quit ();
+ gtk_main_quit ();
}
int
main (int argc, char* argv[])
{
NautilusSearchEngine *engine;
+ NautilusSearchEngineModel *model;
+ NautilusDirectory *directory;
NautilusQuery *query;
+ GFile *location;
gtk_init (&argc, &argv);
@@ -38,8 +41,18 @@ main (int argc, char* argv[])
nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (engine), query);
g_object_unref (query);
+ location = g_file_new_for_path (g_get_home_dir ());
+ directory = nautilus_directory_get (location);
+ g_object_unref (location);
+
+ model = nautilus_search_engine_get_model_provider (engine);
+ nautilus_search_engine_model_set_model (model, directory);
+ g_object_unref (directory);
+
nautilus_search_provider_start (NAUTILUS_SEARCH_PROVIDER (engine));
-
+ nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (engine));
+ g_object_unref (engine);
+
gtk_main ();
return 0;
}