/*
- * Copyright (c) 2017 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.
DALI_TEST_CHECK( progressBar3 == progressBar2 );
//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;
END_TEST;
}
+int UtcDaliProgressBarCopyConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_CHECK( progressBar );
+
+ ProgressBar copy( progressBar );
+ DALI_TEST_CHECK( copy );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarCopyAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_CHECK( progressBar );
+
+ ProgressBar copy;
+ copy = progressBar;
+ DALI_TEST_CHECK( copy );
+ DALI_TEST_EQUALS( progressBar, copy, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarMoveConstructor(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ProgressBar moved = std::move( progressBar );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !progressBar );
+
+ END_TEST;
+}
+
+int UtcDaliProgressBarMoveAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ ProgressBar progressBar = ProgressBar::New();
+ DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ progressBar.SetProperty( Actor::Property::SENSITIVE, false );
+ DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+ ProgressBar moved;
+ moved = std::move( progressBar );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_CHECK( !progressBar );
+
+ END_TEST;
+}
+
int UtcDaliProgressBarDownCast(void)
{
ToolkitTestApplication application;
// Create the ProgressBar actor
ProgressBar progressBar = ProgressBar::New();
- Stage::GetCurrent().Add( progressBar );
+ application.GetScene().Add( progressBar );
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
- Stage::GetCurrent().Add(progressBar);
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
- Stage::GetCurrent().Add(progressBar);
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.3f);
progressBar.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
- Stage::GetCurrent().Add(progressBar);
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
ProgressBar progressBar = ProgressBar::New();
progressBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
progressBar.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y ) );
- Stage::GetCurrent().Add( progressBar );
+ progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, application.GetScene().GetSize().y ) );
+ application.GetScene().Add( progressBar );
application.SendNotification();
application.Render();