lullaby/tests/layout_system_test.cc
// Test that the LayoutSystem will SetOriginalBox and children SetDesiredSize
// in response to a ChildIndexChangedEvent.
Test that the LayoutSystem will SetOriginalBox and children SetDesiredSize
in response to a ChildIndexChangedEvent.
Test that the LayoutSystem will SetOriginalBox and children SetDesiredSize in response to a ChildIndexChangedEvent .
TEST_F(QueuedLayoutSystemTest, ChildIndexChanged) {
  const Entity parent = CreateParent();
  const Entity child_1 = CreateChild(parent, 1.0f);
  const Entity child_2 = CreateChild(parent, 1.0f);
  dispatcher_->Dispatch();
  ClearListeners();
  transform_system_->MoveChild(child_1, 1);
  AssertListenersEmpty();
  dispatcher_->Dispatch();
  AssertListenerMatch({{parent, 1}}, original_boxes_);
  AssertListenerMatch({{child_1, 1}, {child_2, 1}}, desired_sizes_);
  AssertListenerEmpty(actual_boxes_);
}
TEST_F ( QueuedLayoutSystemTest , ChildIndexChanged ) { const Entity parent = CreateParent ( ) ; const Entity child_1 = CreateChild ( parent , 1.0f ) ; const Entity child_2 = CreateChild ( parent , 1.0f ) ; dispatcher_ -> Dispatch ( ) ; ClearListeners ( ) ; transform_system_ -> MoveChild ( child_1 , 1 ) ; AssertListenersEmpty ( ) ; dispatcher_ -> Dispatch ( ) ; AssertListenerMatch ( { { parent , 1 } } , original_boxes_ ) ; AssertListenerMatch ( { { child_1 , 1 } , { child_2 , 1 } } , desired_sizes_ ) ; AssertListenerEmpty ( actual_boxes_ ) ; }
Test that the LayoutSystem will SetOriginalBox and children SetDesiredSize
in response to a ChildIndexChangedEvent.
Test that the LayoutSystem will SetOriginalBox and children SetDesiredSize in response to a ChildIndexChangedEvent .