[ITC][system-settings][ACR-1318][add accesibility check code] 66/200366/1
authorjinwang.an <jinwang.an@samsung.com>
Fri, 22 Feb 2019 07:32:36 +0000 (16:32 +0900)
committerjinwang.an <jinwang.an@samsung.com>
Fri, 22 Feb 2019 07:32:36 +0000 (16:32 +0900)
Change-Id: Iee81d200659099ea9a4f428151ffbb2c80fd0f41
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
src/itc/system-settings/ITs-system-settings-common.c
src/itc/system-settings/ITs-system-settings-common.h
src/itc/system-settings/ITs-system-settings.c

index 4a0ed75ae89829ebed0627f1e9f1cc6ff40ae5b4..557c2dcc36e59b45284f3023b4770dc9553ea6a7 100755 (executable)
@@ -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;
 }
index c7208112d604e190bef305cec1dc14255437d8bc..f447ff05b7cf3ebf1df3611b3edc5cab08119259 100755 (executable)
@@ -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"
 
 
 
index 93e60c11bf7f559dbaf2b32bb524b60cac30b466..0367a22b841cbc03b616e29ecf9c57a0859b725a 100755 (executable)
@@ -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);