[clutter] conform: Make sure that raising/lowering children doesn't change state



commit 85323f09a59130d67a331a0a0feedfccf951d4ed
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Apr 23 14:14:07 2012 -0400

    conform: Make sure that raising/lowering children doesn't change state
    
    Namely, visibility and show-on-set-parent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674510

 tests/conform/actor-graph.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/tests/conform/actor-graph.c b/tests/conform/actor-graph.c
index 6f2db61..8a47543 100644
--- a/tests/conform/actor-graph.c
+++ b/tests/conform/actor-graph.c
@@ -185,17 +185,21 @@ actor_raise_child (TestConformSimpleFixture *fixture,
 {
   ClutterActor *actor = clutter_actor_new ();
   ClutterActor *iter;
+  gboolean show_on_set_parent;
 
   g_object_ref_sink (actor);
 
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "foo",
+                                                "visible", FALSE,
                                                 NULL));
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "bar",
+                                                "visible", FALSE,
                                                 NULL));
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "baz",
+                                                "visible", FALSE,
                                                 NULL));
 
   g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 3);
@@ -215,6 +219,9 @@ actor_raise_child (TestConformSimpleFixture *fixture,
   g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
                    ==,
                    "bar");
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (iter));
+  g_object_get (iter, "show-on-set-parent", &show_on_set_parent);
+  g_assert (!show_on_set_parent);
 
   iter = clutter_actor_get_child_at_index (actor, 0);
   clutter_actor_set_child_above_sibling (actor, iter, NULL);
@@ -228,6 +235,9 @@ actor_raise_child (TestConformSimpleFixture *fixture,
   g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
                    ==,
                    "foo");
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (iter));
+  g_object_get (iter, "show-on-set-parent", &show_on_set_parent);
+  g_assert (!show_on_set_parent);
 
   clutter_actor_destroy (actor);
   g_object_unref (actor);
@@ -239,17 +249,21 @@ actor_lower_child (TestConformSimpleFixture *fixture,
 {
   ClutterActor *actor = clutter_actor_new ();
   ClutterActor *iter;
+  gboolean show_on_set_parent;
 
   g_object_ref_sink (actor);
 
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "foo",
+                                                "visible", FALSE,
                                                 NULL));
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "bar",
+                                                "visible", FALSE,
                                                 NULL));
   clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
                                                 "name", "baz",
+                                                "visible", FALSE,
                                                 NULL));
 
   g_assert_cmpint (clutter_actor_get_n_children (actor), ==, 3);
@@ -269,6 +283,9 @@ actor_lower_child (TestConformSimpleFixture *fixture,
   g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
                    ==,
                    "baz");
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (iter));
+  g_object_get (iter, "show-on-set-parent", &show_on_set_parent);
+  g_assert (!show_on_set_parent);
 
   iter = clutter_actor_get_child_at_index (actor, 2);
   clutter_actor_set_child_below_sibling (actor, iter, NULL);
@@ -282,6 +299,9 @@ actor_lower_child (TestConformSimpleFixture *fixture,
   g_assert_cmpstr (clutter_actor_get_name (clutter_actor_get_child_at_index (actor, 2)),
                    ==,
                    "foo");
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (iter));
+  g_object_get (iter, "show-on-set-parent", &show_on_set_parent);
+  g_assert (!show_on_set_parent);
 
   clutter_actor_destroy (actor);
   g_object_unref (actor);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]