diff --git a/tests/conform/actor-invariants.c b/tests/conform/actor-invariants.c index 5553abb2a..893dfa499 100644 --- a/tests/conform/actor-invariants.c +++ b/tests/conform/actor-invariants.c @@ -122,6 +122,48 @@ actor_mapped (TestConformSimpleFixture *fixture, clutter_actor_destroy (stage); } +void +actor_visibility_not_recursive (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *actor, *group; + ClutterActor *stage; + + stage = clutter_stage_new (); + group = clutter_actor_new (); + actor = clutter_actor_new (); + + clutter_actor_hide (group); /* don't show, so won't map */ + clutter_actor_hide (actor); /* don't show, so won't map */ + + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (stage))); + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group))); + g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); + + clutter_actor_add_child (stage, group); + clutter_actor_add_child (group, actor); + + clutter_actor_show (actor); + g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); + g_assert (!CLUTTER_ACTOR_IS_VISIBLE (group)); + g_assert (!CLUTTER_ACTOR_IS_VISIBLE (stage)); + + clutter_actor_show (stage); + g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); + g_assert (!CLUTTER_ACTOR_IS_VISIBLE (group)); + g_assert (CLUTTER_ACTOR_IS_VISIBLE (stage)); + + clutter_actor_hide (actor); + clutter_actor_hide (group); + clutter_actor_hide (stage); + g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor)); + + clutter_actor_show (stage); + g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor)); + + clutter_actor_destroy (stage); +} + void actor_realize_not_recursive (TestConformSimpleFixture *fixture, gconstpointer data) diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index 6852b111f..a47be11b9 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -152,6 +152,7 @@ main (int argc, char **argv) TEST_CONFORM_SIMPLE ("/actor/invariants", actor_initial_state); TEST_CONFORM_SIMPLE ("/actor/invariants", actor_shown_not_parented); + TEST_CONFORM_SIMPLE ("/actor/invariants", actor_visibility_not_recursive); TEST_CONFORM_SIMPLE ("/actor/invariants", actor_realized); TEST_CONFORM_SIMPLE ("/actor/invariants", actor_realize_not_recursive); TEST_CONFORM_SIMPLE ("/actor/invariants", actor_map_recursive);