Пример #1
0
int UtcDaliStageGetLayerP(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  Layer rootLayer = stage.GetLayer( 0 );
  DALI_TEST_CHECK( rootLayer );

  Layer layer = Layer::New();
  stage.Add( layer );

  Layer sameLayer = stage.GetLayer( 1 );
  DALI_TEST_CHECK( layer == sameLayer );
  END_TEST;
}
Пример #2
0
int UtcDaliStageGetRootLayerP(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  Layer layer = stage.GetLayer( 0 );
  DALI_TEST_CHECK( layer );

  // Check that GetRootLayer() correctly retreived layer 0.
  DALI_TEST_CHECK( stage.GetRootLayer() == layer );

  END_TEST;
}
Пример #3
0
int UtcDaliStageGetLayerN(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  bool asserted = false;
  try
  {
    // Try to get a layer that doesn't exist (note: 0 is the root layer).
    Layer layer = stage.GetLayer( 1 );
  }
  catch( Dali::DaliException& e )
  {
    DALI_TEST_PRINT_ASSERT( e );
    DALI_TEST_ASSERT( e, "depth < mLayers.size()", TEST_LOCATION );
    asserted = true;
  }

  DALI_TEST_CHECK( asserted );
  END_TEST;
}
Пример #4
0
int UtcDaliStageGetRootLayerN(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  Layer rootLayer = stage.GetLayer( 0 );
  DALI_TEST_CHECK( rootLayer );
  DALI_TEST_CHECK( stage.GetRootLayer() == rootLayer );

  // Create a new layer and attempt to lower it below the root layer.
  Layer layer = Layer::New();
  stage.Add( layer );
  layer.LowerToBottom();

  // Check that GetRootLayer still retrieves the same original layer.
  DALI_TEST_CHECK( stage.GetRootLayer() == rootLayer );

  // Check modifying the root layer is also blocked.
  rootLayer.RaiseToTop();
  DALI_TEST_CHECK( stage.GetRootLayer() == rootLayer );

  END_TEST;
}