src/ui/scenic/lib/flatland/tests/flatland_unittest.cc
// This test doesn't use the helper function to create a link, because it tests intermediate steps
// and timing corner cases.
This test doesn't use the helper function to create a link, because it tests intermediate steps
and timing corner cases.
This test doesn ' t use the helper function to create a link because it tests intermediate steps and timing corner cases .
TEST_F(FlatlandTest, ValidParentToChildFlow) {
  Flatland parent = CreateFlatland();
  Flatland child = CreateFlatland();
  ContentLinkToken parent_token;
  GraphLinkToken child_token;
  ASSERT_EQ(ZX_OK, zx::eventpair::create(0, &parent_token.value, &child_token.value));
  const ContentId kLinkId = 1;
  fidl::InterfacePtr<ContentLink> content_link;
  LinkProperties properties;
  properties.set_logical_size({1.0f, 2.0f});
  parent.CreateLink(kLinkId, std::move(parent_token), std::move(properties),
                    content_link.NewRequest());
  fidl::InterfacePtr<GraphLink> graph_link;
  child.LinkToParent(std::move(child_token), graph_link.NewRequest());
  bool layout_updated = false;
  graph_link->GetLayout([&](LayoutInfo info) {
    EXPECT_EQ(1.0f, info.logical_size().x);
    EXPECT_EQ(2.0f, info.logical_size().y);
    layout_updated = true;
  });
  ProcessMainLoop(parent.GetRoot());
  EXPECT_TRUE(layout_updated);
}
TEST_F ( FlatlandTest , ValidParentToChildFlow ) { Flatland parent = CreateFlatland ( ) ; Flatland child = CreateFlatland ( ) ; ContentLinkToken parent_token ; GraphLinkToken child_token ; ASSERT_EQ ( ZX_OK , zx :: eventpair :: create ( 0 , & parent_token . value , & child_token . value ) ) ; const ContentId kLinkId = 1 ; fidl :: InterfacePtr < ContentLink > content_link ; LinkProperties properties ; properties . set_logical_size ( { 1.0f , 2.0f } ) ; parent . CreateLink ( kLinkId , std :: move ( parent_token ) , std :: move ( properties ) , content_link . NewRequest ( ) ) ; fidl :: InterfacePtr < GraphLink > graph_link ; child . LinkToParent ( std :: move ( child_token ) , graph_link . NewRequest ( ) ) ; bool layout_updated = false ; graph_link -> GetLayout ( [ & ] ( LayoutInfo info ) { EXPECT_EQ ( 1.0f , info . logical_size ( ) . x ) ; EXPECT_EQ ( 2.0f , info . logical_size ( ) . y ) ; layout_updated = true ; } ) ; ProcessMainLoop ( parent . GetRoot ( ) ) ; EXPECT_TRUE ( layout_updated ) ; }
This test doesn't use the helper function to create a link, because it tests intermediate steps
and timing corner cases.
This test doesn ' t use the helper function to create a link because it tests intermediate steps and timing corner cases .
// Without even presenting, the child is able to get the initial properties from the parent.