void ButtonInitialAutoRepeatingDelayProperty();
void ButtonNextAutoRepeatingDelayProperty();
void ButtonTogglableProperty();
+void ButtonSetUnselectedVisual();
+void ButtonSetSelectedVisual();
+void ButtonSetDisabledSelectedVisual();
+void ButtonSetDisabledUnselectedVisual();
+void ButtonSetUnselectedBackgroundVisual();
+void ButtonSetSelectedBackgroundVisual();
+void ButtonSetDisabledUnselectedBackgroundVisual();
+void ButtonSetDisabledSelectedBackgroundVisual();
+
namespace
{
BUTTON_AUTO_REPEATING_PROPERTY,
BUTTON_INITIAL_AUTO_REPEATING_DELAY_PROPERTY,
BUTTON_NEXT_AUTO_REPEATING_DELAY_PROPERTY,
- BUTTON_TOGGLABLE_PROPERTY
+ BUTTON_TOGGLABLE_PROPERTY,
+ BUTTON_SET_UNSELECTED_VISUAL,
+ BUTTON_SET_SELECTED_VISUAL,
+ BUTTON_SET_DISABLED_SELECTED_VISUAL,
+ BUTTON_SET_DISABLED_UNSELECTED_VISUAL,
+ BUTTON_SET_UNSELECTED_BACKGROUND_VISUAL,
+ BUTTON_SET_SELECTED_BACKGROUND_VISUAL,
+ BUTTON_SET_DISABLED_UNSELECTED_BACKGROUND_VISUAL,
+ BUTTON_SET_DISABLED_SELECTED_BACKGROUND_VISUAL
};
struct Button_TestApp : public ConnectionTracker
case BUTTON_TOGGLABLE_PROPERTY:
ButtonTogglableProperty();
break;
+
+ case BUTTON_SET_UNSELECTED_VISUAL:
+ ButtonSetUnselectedVisual();
+ break;
+
+ case BUTTON_SET_SELECTED_VISUAL:
+ ButtonSetSelectedVisual();
+ break;
+
+ case BUTTON_SET_DISABLED_SELECTED_VISUAL:
+ ButtonSetDisabledSelectedVisual();
+ break;
+
+ case BUTTON_SET_DISABLED_UNSELECTED_VISUAL:
+ ButtonSetDisabledUnselectedVisual();
+ break;
+
+ case BUTTON_SET_UNSELECTED_BACKGROUND_VISUAL:
+ ButtonSetUnselectedBackgroundVisual();
+ break;
+
+ case BUTTON_SET_SELECTED_BACKGROUND_VISUAL:
+ ButtonSetSelectedBackgroundVisual();
+ break;
+
+ case BUTTON_SET_DISABLED_UNSELECTED_BACKGROUND_VISUAL:
+ ButtonSetDisabledUnselectedBackgroundVisual();
+ break;
+
+ case BUTTON_SET_DISABLED_SELECTED_BACKGROUND_VISUAL:
+ ButtonSetDisabledSelectedBackgroundVisual();
+ break;
}
}
// Data
DaliLog::PrintPass();
}
+void ButtonSetUnselectedVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::UNSELECTED_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get UNSELECTED_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::UNSELECTED_VISUAL );
+ Property::Map *unselectedVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!unselectedVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetSelectedVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::SELECTED_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get SELECTED_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::SELECTED_VISUAL );
+ Property::Map *selectedVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!selectedVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetDisabledSelectedVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::DISABLED_SELECTED_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get DISABLED_SELECTED_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::DISABLED_SELECTED_VISUAL );
+ Property::Map *disableSelectedVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!disableSelectedVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetDisabledUnselectedVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::DISABLED_UNSELECTED_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get DISABLED_UNSELECTED_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::DISABLED_UNSELECTED_VISUAL );
+ Property::Map *disableUnselectedVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!disableUnselectedVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetUnselectedBackgroundVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get UNSELECTED_BACKGROUND_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL );
+ Property::Map *unselectedBackgroundVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!unselectedBackgroundVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetSelectedBackgroundVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get SELECTED_BACKGROUND_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL );
+ Property::Map *selectedBackgroundVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!selectedBackgroundVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetDisabledUnselectedBackgroundVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get DISABLED_UNSELECTED_BACKGROUND_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
+ Property::Map *disableUnselectedBackroundVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!disableUnselectedBackroundVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
+void ButtonSetDisabledSelectedBackgroundVisual()
+{
+ Button button = PushButton::New();
+ DALI_CHECK_INSTANCE(button,"PushButton::New() is failed to create valid button object ");
+
+ string strButtonImagePath=getResourceFullPath(PUSH_BUTTON_IMAGE);
+ DALI_CHECK_FAIL(strButtonImagePath == "", "Unable to get resource path from app data directory." );
+
+ try
+ {
+ button.SetProperty( Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, strButtonImagePath );
+ }
+ catch(DaliException& de)
+ {
+ LOG_E("Get DISABLED_SELECTED_BACKGROUND_VISUAL Property is failed.");
+ DaliLog::PrintV(LOG_ERROR, SUITE_NAME, "Dali Exception Thrown, location: %s, condition: %s, at [LINE: %d]", de.location, de.condition, __LINE__);
+ test_return_value=1;
+ return;
+ }
+
+ Property::Value value = button.GetProperty( Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL );
+ Property::Map *disableSelectedBackroundVisualProperty = value.GetMap();
+ DALI_CHECK_FAIL(!disableSelectedBackroundVisualProperty, "Unable to get value from map." );
+
+ strButtonImagePath.clear();
+ DaliLog::PrintPass();
+}
+
/**
* End of TC Logic Implementation Area.
**/
return test_return_value;
}
+//& purpose: To set the unselected button foreground/icon visual
+//& type auto
+/**
+* @testcase ITcButtonSetUnselectedVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the unselected button foreground/icon visual
+* @scenario Creates a Button instance. \n
+* Sets the UNSELECTED_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::UNSELECTED_VISUAL
+* @passcase Set api works properly for UNSELECTED_VISUAL property.
+* @failcase Set api does not works properly for UNSELECTED_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetUnselectedVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_UNSELECTED_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the selected button foreground/icon visual
+//& type auto
+/**
+* @testcase ITcButtonSetSelectedVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the selected button foreground/icon visual
+* @scenario Creates a Button instance. \n
+* Sets the SELECTED_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::SELECTED_VISUAL
+* @passcase Set api works properly for SELECTED_VISUAL property.
+* @failcase Set api does not works properly for SELECTED_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetSelectedVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_SELECTED_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the disabled selected state foreground/icon button visual
+//& type auto
+/**
+* @testcase ITcButtonSetDisabledSelectedVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the disabled selected state foreground/icon button visual
+* @scenario Creates a Button instance. \n
+* Sets the DISABLED_SELECTED_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::DISABLED_SELECTED_VISUAL
+* @passcase Set api works properly for DISABLED_SELECTED_VISUAL property.
+* @failcase Set api does not works properly for DISABLED_SELECTED_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetDisabledSelectedVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_DISABLED_SELECTED_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the disabled unselected state foreground/icon visual
+//& type auto
+/**
+* @testcase ITcButtonSetDisabledUnselectedVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the disabled unselected state foreground/icon visual
+* @scenario Creates a Button instance. \n
+* Sets the DISABLED_UNSELECTED_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::DISABLED_UNSELECTED_VISUAL
+* @passcase Set api works properly for DISABLED_UNSELECTED_VISUAL property.
+* @failcase Set api does not works properly for DISABLED_UNSELECTED_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetDisabledUnselectedVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_DISABLED_UNSELECTED_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the disabled in the unselected state background, button visual
+//& type auto
+/**
+* @testcase ITcButtonSetUnselectedBackgroundVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the disabled in the unselected state background, button visual
+* @scenario Creates a Button instance. \n
+* Sets the UNSELECTED_BACKGROUND_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::UNSELECTED_BACKGROUND_VISUAL
+* @passcase Set api works properly for UNSELECTED_BACKGROUND_VISUAL property.
+* @failcase Set api does not works properly for UNSELECTED_BACKGROUND_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetUnselectedBackgroundVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_UNSELECTED_BACKGROUND_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the selected background button visual
+//& type auto
+/**
+* @testcase ITcButtonSetSelectedBackgroundVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the selected background button visual
+* @scenario Creates a Button instance. \n
+* Sets the SELECTED_BACKGROUND_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::SELECTED_BACKGROUND_VISUAL
+* @passcase Set api works properly for SELECTED_BACKGROUND_VISUAL property.
+* @failcase Set api does not works properly for SELECTED_BACKGROUND_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetSelectedBackgroundVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_SELECTED_BACKGROUND_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the disabled while unselected background button visual
+//& type auto
+/**
+* @testcase ITcButtonSetDisabledUnselectedBackgroundVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the disabled while unselected background button visual
+* @scenario Creates a Button instance. \n
+* Sets the DISABLED_UNSELECTED_BACKGROUND_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL
+* @passcase Set api works properly for DISABLED_UNSELECTED_BACKGROUND_VISUAL property.
+* @failcase Set api does not works properly for DISABLED_UNSELECTED_BACKGROUND_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetDisabledUnselectedBackgroundVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_DISABLED_UNSELECTED_BACKGROUND_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+//& purpose: To set the disabled while selected background button visual
+//& type auto
+/**
+* @testcase ITcButtonSetDisabledSelectedBackgroundVisual
+* @since_tizen 5.5
+* @type Positive
+* @description Sets the disabled while selected background button visual
+* @scenario Creates a Button instance. \n
+* Sets the DISABLED_SELECTED_BACKGROUND_VISUAL property. \n
+* @apicovered PushButton::New(), Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL
+* @passcase Set api works properly for DISABLED_SELECTED_BACKGROUND_VISUAL property.
+* @failcase Set api does not works properly for DISABLED_SELECTED_BACKGROUND_VISUAL property.
+* @precondition NA
+* @postcondition NA
+*/
+int ITcButtonSetDisabledSelectedBackgroundVisual(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ Button_TestApp testApp( application, BUTTON_SET_DISABLED_SELECTED_BACKGROUND_VISUAL );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
/** @} */ // end of itc-button-testcases
/** @} */ // end of itc-button
/** @} */ // end of itc-dali-toolkit