From: Bartlomiej Grzelewski Date: Thu, 1 Oct 2020 07:29:07 +0000 (+0200) Subject: [AT-SPI] Improving utc coverage ToggleButton tests X-Git-Tag: dali_2.0.0~6^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d2b7fe74204ee70c10e31c35f7c52b9371ee383;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [AT-SPI] Improving utc coverage ToggleButton tests Coverage for GetNamePropertyIndex Change-Id: Id291b2624916c2e1c451a3c8e7568429c994afb9 --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp index a50c9a96ff..c68e84f96f 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -161,6 +162,67 @@ int UtcDaliControlAccessibilityRole(void) END_TEST; } +int UtcDaliControlAccessibilityRoleToggleButton(void) +{ + ToolkitTestApplication application; + + auto control = Dali::Toolkit::ToggleButton::New(); + auto button = Dali::Accessibility::Role::TOGGLE_BUTTON; + + control.SetProperty(Toolkit::ToggleButton::Property::TOOLTIPS, + Property::Array{"option1", "option2"}); + + Dali::Accessibility::TestEnableSC( true ); + + control.SetProperty( DevelControl::Property::ACCESSIBILITY_ROLE, button ); + auto q = Dali::Accessibility::Accessible::Get( control ); + + DALI_TEST_EQUALS( button , q->GetRole(), TEST_LOCATION); + DALI_TEST_EQUALS( "toggle button" , q->GetRoleName(), TEST_LOCATION ); + + Dali::Accessibility::States states = q->GetStates(); + DALI_TEST_EQUALS( true , (bool)states[Dali::Accessibility::State::VISIBLE], TEST_LOCATION); + + DALI_TEST_EQUALS( "option1", q->GetDescription(), TEST_LOCATION ); + + auto i = dynamic_cast(q); + if (i) + i->GrabHighlight(); + + control.SetProperty( Toolkit::Button::Property::LABEL, "ToggleButton2" ); + DALI_TEST_EQUALS( "ToggleButton2", TestGetName( q->GetAddress() ), TEST_LOCATION ); + + Dali::Accessibility::TestEnableSC( false ); + + END_TEST; +} + +int UtcDaliControlAccessibilityButtonLabel(void) +{ + ToolkitTestApplication application; + + auto control = Dali::Toolkit::PushButton::New(); + auto button = Dali::Accessibility::Role::PUSH_BUTTON; + + Dali::Accessibility::TestEnableSC( true ); + + control.SetProperty( DevelControl::Property::ACCESSIBILITY_ROLE, button ); + + auto q = Dali::Accessibility::Accessible::Get( control ); + auto i = dynamic_cast(q); + + if (i) + i->GrabHighlight(); + + control.SetProperty( Toolkit::Button::Property::LABEL, "Button2" ); + + DALI_TEST_EQUALS( "Button2" , TestGetName( q->GetAddress() ), TEST_LOCATION ); + + Dali::Accessibility::TestEnableSC( false ); + + END_TEST; +} + int UtcDaliControlAccessibilityState(void) { ToolkitTestApplication application;