/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
const unsigned int TOTAL_PAGE_NUMBER = 20;
-const Vector2 PAGE_SIZE( 300.f,400.f );
+const Vector2 VIEW_PAGE_SIZE( 300.f,400.f );
const Vector2 SPINE_SHADOW_PARAMETER( 60.0f, 30.0f );
static bool gObjectCreatedCallBackCalled;
// Test object creation
TestPageFactory factory;
- portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+ portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( portraitView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect( &TestCallback );
{
TestPageFactory factory;
- PageTurnView portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+ PageTurnView portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
}
DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
// Test object creation
TestPageFactory factory;
- landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+ landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( landscapeView );
//Additional check to ensure object is created by checking if it's registered
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect( &TestCallback );
{
TestPageFactory factory;
- PageTurnView landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+ PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
}
DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
// Test object creation
TestPageFactory factory;
- portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+ portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( portraitView );
// Test copy constructor
// Test object creation
TestPageFactory factory;
- landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+ landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( landscapeView );
// Test copy constructor
tet_infoline(" UtcDaliPageTurnViewSetGetProperty ");
TestPageFactory factory;
- PageTurnView landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+ PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
DALI_TEST_CHECK( landscapeView );
- Stage::GetCurrent().Add( landscapeView );
+ application.GetScene().Add( landscapeView );
- // Test "pageSize" property
- DALI_TEST_CHECK( landscapeView.GetPropertyIndex("pageSize") == PageTurnView::Property::PAGE_SIZE );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), PAGE_SIZE, TEST_LOCATION );
+ // Test "viewPageSize" property
+ DALI_TEST_CHECK( landscapeView.GetPropertyIndex("viewPageSize") == PageTurnView::Property::VIEW_PAGE_SIZE );
+ DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), VIEW_PAGE_SIZE, TEST_LOCATION );
- Vector2 newSize( PAGE_SIZE.x*0.75, PAGE_SIZE.y*0.5f );
- landscapeView.SetProperty( PageTurnView::Property::PAGE_SIZE, newSize );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION );
+ Vector2 newSize( VIEW_PAGE_SIZE.x*0.75, VIEW_PAGE_SIZE.y*0.5f );
+ landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE, newSize );
+ DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION );
Wait( application);
DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*2.f, newSize.y), TEST_LOCATION);
- landscapeView.SetProperty( PageTurnView::Property::PAGE_SIZE,newSize*1.5f);
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), newSize*1.5f, TEST_LOCATION );
+ landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE,newSize*1.5f);
+ DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize*1.5f, TEST_LOCATION );
Wait( application);
DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*3.f, newSize.y*1.5f), TEST_LOCATION);
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
TestPageFactory factory;
- Vector2 size = Stage::GetCurrent().GetSize();
+ Vector2 size = application.GetScene().GetSize();
PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
- portraitView.SetParentOrigin( ParentOrigin::CENTER );
- Stage::GetCurrent().Add( portraitView );
+ portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ application.GetScene().Add( portraitView );
// Render and notify
application.SendNotification();
*/
TestPageFactory factory;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
PageTurnView landscapeView = PageTurnLandscapeView::New( factory, Vector2(stageSize.x*0.5f, stageSize.x*0.8f) );
- landscapeView.SetParentOrigin( ParentOrigin::CENTER );
- Stage::GetCurrent().Add( landscapeView );
+ landscapeView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ application.GetScene().Add( landscapeView );
// Render and notify
application.SendNotification();
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
TestPageFactory factory( false /* returns empty handles */ );
- Vector2 size = Stage::GetCurrent().GetSize();
+ Vector2 size = application.GetScene().GetSize();
try
{
PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
- portraitView.SetParentOrigin( ParentOrigin::CENTER );
- Stage::GetCurrent().Add( portraitView );
+ portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ application.GetScene().Add( portraitView );
tet_result(TET_FAIL);
}