From: jinwang.an Date: Fri, 22 Feb 2019 07:32:36 +0000 (+0900) Subject: [ITC][system-settings][ACR-1318][add accesibility check code] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F200366%2F1;p=test%2Ftct%2Fnative%2Fapi.git [ITC][system-settings][ACR-1318][add accesibility check code] Change-Id: Iee81d200659099ea9a4f428151ffbb2c80fd0f41 Signed-off-by: jinwang.an --- diff --git a/src/itc/system-settings/ITs-system-settings-common.c b/src/itc/system-settings/ITs-system-settings-common.c index 4a0ed75ae..557c2dcc3 100755 --- a/src/itc/system-settings/ITs-system-settings-common.c +++ b/src/itc/system-settings/ITs-system-settings-common.c @@ -89,6 +89,8 @@ char* SystemSettingsGetKey(int nVal) case SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE: pszText= "SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE"; break; case SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE: pszText="SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE"; break; + case SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE: pszText="SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE"; break; + case SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR: pszText="SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR"; break; } return pszText; } diff --git a/src/itc/system-settings/ITs-system-settings-common.h b/src/itc/system-settings/ITs-system-settings-common.h index c7208112d..f447ff05b 100755 --- a/src/itc/system-settings/ITs-system-settings-common.h +++ b/src/itc/system-settings/ITs-system-settings-common.h @@ -34,6 +34,8 @@ #define SYSTEM_SETTINGS_NOTIFICATION_EMAIL_FEATURE "http://tizen.org/feature/systemsetting.notification_email" #define SYSTEM_SETTINGS_TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony" #define SYSTEM_SETTINGS_INCOMING_CALL_FEATURE "http://tizen.org/feature/systemsetting.incoming_call" +#define SYSTEM_SETTINGS_ACCESSIBILITY_GRAYSCALE_FEATURE "http://tizen.org/feature/accessibility.grayscale" +#define SYSTEM_SETTINGS_ACCESSIBILITY_NEGATIVE_FEATURE "http://tizen.org/feature/accessibility.negative" diff --git a/src/itc/system-settings/ITs-system-settings.c b/src/itc/system-settings/ITs-system-settings.c index 93e60c11b..0367a22b8 100755 --- a/src/itc/system-settings/ITs-system-settings.c +++ b/src/itc/system-settings/ITs-system-settings.c @@ -24,6 +24,8 @@ bool g_bSystemSettingsNotSupported = false; bool g_bSystemSettingsFontNotSupported = false; bool g_bSystemSettingsTelyphoneyNotSupported = false; bool g_bSystemSettingsIncomingCallNotSupported = false; +bool g_bSystemSettingsGrayscaleNotSupported = false; +bool g_bSystemSettingsNegativeNotSupported = false; /** * @function ITs_system_settings_startup * @description Called before each test @@ -57,12 +59,20 @@ void ITs_system_settings_startup(void) } if ( !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_TELEPHONY_FEATURE, API_NAMESPACE) ) { - g_bSystemSettingsTelyphoneyNotSupported = true; + g_bSystemSettingsTelyphoneyNotSupported = true; } if (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_INCOMING_CALL_FEATURE, API_NAMESPACE) ) { g_bSystemSettingsIncomingCallNotSupported = true; } + if (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ACCESSIBILITY_GRAYSCALE_FEATURE, API_NAMESPACE) ) + { + g_bSystemSettingsGrayscaleNotSupported = true; + } + if (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ACCESSIBILITY_NEGATIVE_FEATURE, API_NAMESPACE) ) + { + g_bSystemSettingsNegativeNotSupported = true; + } return; } @@ -90,7 +100,7 @@ void ITs_system_settings_cleanup(void) */ void System_settings_changed_cb_p(system_settings_key_e key, void *user_data) { - /*without set, callback wil not hit*/ + /*without set, callback wil not hit*/ /*all setter in under non public api so we are not using in TCs*/ } @@ -138,7 +148,9 @@ int ITc_system_settings_get_value_bool_p(void) SYSTEM_SETTINGS_KEY_ACCESSIBILITY_TTS,//GET SYSTEM_SETTINGS_KEY_VIBRATION,//GET SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE, //GET - SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE + SYSTEM_SETTINGS_KEY_DEVELOPER_OPTION_STATE, + SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE, + SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR }; int nEnumSize = sizeof(eSystem_Settings_Key) / sizeof(eSystem_Settings_Key[0]); int enum_counter=0; @@ -151,6 +163,7 @@ int ITc_system_settings_get_value_bool_p(void) if(key == SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION && (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_NETWORK_WIFI_FEATURE,API_NAMESPACE)) && (nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED)) { continue; + } if(g_bSystemSettingsNotSupported) { @@ -165,22 +178,50 @@ int ITc_system_settings_get_value_bool_p(void) return 1; } } - if(g_bSystemSettingsTelyphoneyNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE) - { - if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) - { - FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 0; - } - else - { - FPRINTF("\\n[Line : %d][%s] Feature mismatch , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 1; - } - } - - - PRINT_RESULT(SYSTEM_SETTINGS_ERROR_NONE, nRetVal, "system_settings_get_value_bool", SystemSettingsGetError(nRetVal)); + + if(g_bSystemSettingsTelyphoneyNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE) + { + if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) + { + FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 0; + } + else + { + FPRINTF("\\n[Line : %d][%s] Feature mismatch , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 1; + } + } + + if(g_bSystemSettingsGrayscaleNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE) + { + if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) + { + FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 0; + } + else + { + FPRINTF("\\n[Line : %d][%s] Feature mismatch , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 1; + } + } + + if(g_bSystemSettingsNegativeNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR) + { + if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) + { + FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 0; + } + else + { + FPRINTF("\\n[Line : %d][%s] Feature mismatch , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); + return 1; + } + } + + PRINT_RESULT(SYSTEM_SETTINGS_ERROR_NONE, nRetVal, "system_settings_get_value_bool", SystemSettingsGetError(nRetVal)); } return 0; } @@ -203,7 +244,7 @@ int ITc_system_settings_get_value_bool_p(void) */ int ITc_system_settings_get_value_string_p(void) { - START_TEST; + START_TEST; int nRetVal = 0; char *pszGetPath = NULL; system_settings_key_e e_System_Settings_Key[]= @@ -430,12 +471,12 @@ int ITc_system_settings_add_remove_changed_cb_p(void) { continue; } - + if(nkey_idx == SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE && (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_NOTIFICATION_EMAIL_FEATURE, API_NAMESPACE)) ) { continue; } - + if ( nkey_idx == (SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 1) || nkey_idx == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE ) continue; @@ -443,6 +484,14 @@ int ITc_system_settings_add_remove_changed_cb_p(void) { continue; } + if(nkey_idx == SYSTEM_SETTINGS_KEY_ACCESSIBILITY_GRAYSCALE && (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ACCESSIBILITY_GRAYSCALE_FEATURE, API_NAMESPACE)) ) + { + continue; + } + if(nkey_idx == SYSTEM_SETTINGS_KEY_ACCESSIBILITY_NEGATIVE_COLOR && (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ACCESSIBILITY_NEGATIVE_FEATURE, API_NAMESPACE)) ) + { + continue; + } nRetVal = system_settings_add_changed_cb(nkey_idx,System_settings_changed_add_remove_cb, NULL);