[UTC][webkit2][Non-ACR] Change the path of database file for form autofill 11/306511/2
authoryh106.jung <yh106.jung@samsung.com>
Thu, 22 Feb 2024 08:38:16 +0000 (17:38 +0900)
committerYoungha Jung <yh106.jung@samsung.com>
Thu, 22 Feb 2024 08:45:42 +0000 (08:45 +0000)
The path of database file for form autofill was changed by chromium
upstream.
So this patch updates to the changed path.

Change-Id: Iea2116af686141ead39e7ad5de555c2087cbf277
Signed-off-by: yh106.jung <yh106.jung@samsung.com>
src/utc/webkit2/tct-autofill-profile.c
src/utc/webkit2/tct-autofill-profile.h
src/utc/webkit2/utc_webkit2_ewk.h
src/utc/webkit2/utc_webkit2_ewk_context_form_autofill_profile_add_func.c
src/utc/webkit2/utc_webkit2_ewk_context_form_autofill_profile_get_all_func.c
src/utc/webkit2/utc_webkit2_ewk_context_form_autofill_profile_get_func.c
src/utc/webkit2/utc_webkit2_ewk_context_form_autofill_profile_remove_func.c
src/utc/webkit2/utc_webkit2_ewk_context_form_autofill_profile_set_func.c

index 23447fb58606b025ae5cb47acfb3def87cacbe88..c489a1cb099db8c56715a9081e2a6f1c79c1adfd 100755 (executable)
@@ -15,6 +15,7 @@ limitations under the License.
 
 #include <stdio.h>
 #include <stdlib.h>
+#include "tct_common.h"
 #include "tct-autofill-profile.h"
 
 Ewk_Autofill_Profile* getTestEwkAutofillProfile()
@@ -39,3 +40,17 @@ Ewk_Autofill_Profile* getTestEwkAutofillProfile()
 
     return profile;
 }
+
+void removeFormDatabase() {
+    char rmCommand[PATH_MAX + 4] = {0, };
+    char appsPath[CONFIG_VALUE_LEN_MAX] = { 0, };
+
+    if (!GetValueForTCTSetting("DEVICE_OTHER_USER_APPS_ROOT_30", appsPath, API_NAMESPACE))
+    {
+        FPRINTF("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_OTHER_USER_APPS_ROOT_30'\n", __LINE__, API_NAMESPACE);
+        return;
+    }
+
+    snprintf(rmCommand, PATH_MAX + 3, "rm %s/org.tizen.webkit2-native-utc/data/chromium-efl/data/db/.FormData.db", appsPath);
+    system(rmCommand);
+}
index 709f7ea25db42e46cde21a46b8ede170e88db30c..b38d07923fa41ea76086882ba11259ef70a42563 100755 (executable)
@@ -33,4 +33,6 @@ static const char* const  TEST_AUTOFILL_PROFILE_EMAIL                 =   "someE
 
 Ewk_Autofill_Profile* getTestEwkAutofillProfile();
 
+void removeFormDatabase();
+
 #endif
index 870a65953e17cda9c43f971670dfb81d0e68c897..85dfc7d0b8641462a77e84226a9e2394f22be755 100755 (executable)
@@ -34,6 +34,8 @@ extern "C" {
 #endif
 
 /* Definitions and macros */
+#define API_NAMESPACE "WEBKIT2_UTC"
+
 #define UNUSED __attribute__((unused))
 
 #define DEFAULT_WIDTH_OF_WINDOW 480
index 272e63f318a31c6e4bc76016d0a8587ec8ae1bc6..9060aa8942d2bb6cccf96145a211ad862f15ebb2 100755 (executable)
@@ -29,7 +29,7 @@
 void utc_webkit2_ewk_context_form_autofill_profile_add_func_startup(void)
 {
     utc_webkit2_ewk_test_init();
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
 }
 
 /**
@@ -40,7 +40,7 @@ void utc_webkit2_ewk_context_form_autofill_profile_add_func_startup(void)
  */
 void utc_webkit2_ewk_context_form_autofill_profile_add_func_cleanup(void)
 {
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
     utc_webkit2_ewk_test_end();
 }
 
index bfc26f73969d6f8ef29d20a93f54cee7d4584fcf..8371b207e276cb3f4a35664b7d56af19485fa133 100755 (executable)
@@ -29,7 +29,7 @@
 void utc_webkit2_ewk_context_form_autofill_profile_get_all_func_startup(void)
 {
     utc_webkit2_ewk_test_init();
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
 }
 
 /**
@@ -40,7 +40,7 @@ void utc_webkit2_ewk_context_form_autofill_profile_get_all_func_startup(void)
  */
 void utc_webkit2_ewk_context_form_autofill_profile_get_all_func_cleanup(void)
 {
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
     utc_webkit2_ewk_test_end();
 }
 
index 8d91234381f16c89ee8671737f5c9c352f366d23..a93c2a3e6d9eb7b6d85f1807ece74c64b75de3aa 100755 (executable)
@@ -29,7 +29,7 @@
 void utc_webkit2_ewk_context_form_autofill_profile_get_func_startup(void)
 {
     utc_webkit2_ewk_test_init();
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
 }
 
 /**
@@ -40,7 +40,7 @@ void utc_webkit2_ewk_context_form_autofill_profile_get_func_startup(void)
  */
 void utc_webkit2_ewk_context_form_autofill_profile_get_func_cleanup(void)
 {
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
     utc_webkit2_ewk_test_end();
 }
 
index fb6d5a1c604f3cef08c0bc140523bcd2d3efb5ce..f7dfeaa18a7edc5031654609403b8d6c921f3e4d 100755 (executable)
@@ -29,7 +29,7 @@
 void utc_webkit2_ewk_context_form_autofill_profile_remove_func_startup(void)
 {
     utc_webkit2_ewk_test_init();
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
 }
 
 /**
@@ -40,7 +40,7 @@ void utc_webkit2_ewk_context_form_autofill_profile_remove_func_startup(void)
  */
 void utc_webkit2_ewk_context_form_autofill_profile_remove_func_cleanup(void)
 {
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
     utc_webkit2_ewk_test_end();
 }
 
index 25f31ac7a655f74e8e98b9bb0313075cb6b0671b..1e33969e92d9f194a469c731a23d26231c8f3871 100755 (executable)
@@ -29,7 +29,7 @@
 void utc_webkit2_ewk_context_form_autofill_profile_set_func_startup(void)
 {
     utc_webkit2_ewk_test_init();
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
 }
 
 /**
@@ -40,7 +40,7 @@ void utc_webkit2_ewk_context_form_autofill_profile_set_func_startup(void)
  */
 void utc_webkit2_ewk_context_form_autofill_profile_set_func_p_cleanup(void)
 {
-    system("rm /usr/apps/core-webkit2-tests/data/.webkit/formDatabase/WebpageForms.db");
+    removeFormDatabase();
     utc_webkit2_ewk_test_end();
 }