Fix NativeTCT autofill itc/utc failures 52/320252/6
authorSatyaveer Singh <satyaveer.s@samsung.com>
Mon, 11 Nov 2024 13:39:55 +0000 (19:09 +0530)
committerBot Blink <blinkbot@samsung.com>
Tue, 19 Nov 2024 01:09:07 +0000 (01:09 +0000)
This patch makes necessary changes as per upstream change.
This commit fixes below itc/utc failures:
1) ITc_ewk_context_form_autofill_profile_add_remove_p
2) ITc_ewk_context_form_autofill_profile_get_all_p
3) utc_webkit2_ewk_context_autofill_profile_add_remove_p
4) utc_webkit2_ewk_context_autofill_profile_get_all_p

Change-Id: I4a6e469e054f9a49d4e4eb883f30fa458b909636
Signed-off-by: Satyaveer Singh <satyaveer.s@samsung.com>
tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc
tizen_src/ewk/efl_integration/browser/webdata/web_data_service_factory.cc
tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc

index 3fac5c2b0b863b1d43e2b270147c3cdfa0f4074f..891dea3f97de73f76baaacb7ba4501283803096d 100644 (file)
@@ -51,17 +51,17 @@ PersonalDataManagerFactoryEfl::PersonalDataManagerForContext(
     return nullptr;
   }
 
-#if !defined(EWK_BRINGUP)  // FIXME: m126 bringup
   std::unique_ptr<PersonalDataManager> pdm(new PersonalDataManager(
-      content::GetContentClientExport()->browser()->GetApplicationLocale()));
+      WebDataServiceFactoryEfl::GetAutofillWebDataForProfile(),
+      /*account_database*/ nullptr, service, /*local_state*/ nullptr,
+      /*identity_manager*/ nullptr, /*history_service*/ nullptr,
+      /*sync_service*/ nullptr, /*strike_database*/ nullptr,
+      /*image_fetcher*/ nullptr, /*shared_storage_handler*/ nullptr,
+      content::GetContentClientExport()->browser()->GetApplicationLocale(),
+      /*variations_country_code*/ ""));
   manager = pdm.get();
-
-  manager->Init(WebDataServiceFactoryEfl::GetAutofillWebDataForProfile(),
-                nullptr, service, nullptr, nullptr, nullptr, nullptr, nullptr,
-                nullptr);
   manager->AddObserver(this);
   personal_data_manager_id_map_.AddWithID(std::move(pdm), unique_id);
-#endif
 
   return manager;
 }
index 2050ba4a9c02f3522fde1e100d7a228847212724..589ae9080e74195fc5a32f8160398929e3a0aece 100644 (file)
 #include "base/path_service.h"
 #include "base/task/thread_pool.h"
 #include "components/autofill/core/browser/geo/autofill_country.h"
+#include "components/autofill/core/browser/webdata/addresses/address_autofill_table.h"
 #include "components/autofill/core/browser/webdata/autocomplete/autocomplete_table.h"
 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
+#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
 #include "components/webdata/common/webdata_constants.h"
 #include "content/common/paths_efl.h"
 #include "eweb_view.h"
@@ -60,6 +62,8 @@ WebDataServiceWrapperEfl::WebDataServiceWrapperEfl() {
   // All tables objects that participate in managing the database must
   // be added here.
   web_database_->AddTable(std::make_unique<autofill::AutocompleteTable>());
+  web_database_->AddTable(std::make_unique<autofill::AddressAutofillTable>());
+  web_database_->AddTable(std::make_unique<autofill::PaymentsAutofillTable>());
   web_database_->LoadDatabase();
 
   autofill_web_data_ =
index 4c0d4828e9d305550cf4a175151e46f8230008d3..b5725ff76bc6aa2a849ee2fcbd3bebaaaa5ee566 100644 (file)
@@ -211,9 +211,10 @@ EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get_all(
   DCHECK(manager);
 
   Eina_List* list = nullptr;
-#if !defined(EWK_BRINGUP)  // FIXME: m126 bringup
+
   std::vector<autofill::AutofillProfile*> dataVector =
-      manager->GetProfiles();
+      manager->address_data_manager().GetProfiles();
+
   for (unsigned i = 0; i < dataVector.size(); ++i) {
     autofill::AutofillProfile* profile = dataVector[i];
     if (profile) {
@@ -222,7 +223,6 @@ EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get_all(
         list = eina_list_append(list, p);
     }
   }
-#endif
   return list;
 }
 
@@ -236,12 +236,13 @@ EwkContextFormAutofillProfileManager::priv_form_autofill_profile_get(
   DCHECK(manager);
 
   Ewk_Autofill_Profile* ret = nullptr;
-#if !defined(EWK_BRINGUP)  // FIXME: m126 bringup
-  autofill::AutofillProfile* profile = manager->GetProfileByGUID(UnsignedToGUID(id));
+
+  autofill::AutofillProfile* profile =
+      manager->address_data_manager().GetProfileByGUID(UnsignedToGUID(id));
 
   if (profile)
     ret = to_Ewk_Autofill_Profile(*profile);
-#endif
+
   return ret;
 }
 
@@ -254,13 +255,15 @@ Eina_Bool EwkContextFormAutofillProfileManager::priv_form_autofill_profile_set(
       PersonalDataManagerForEWKContext(ewk_context);
   DCHECK(manager);
 
-#if !defined(EWK_BRINGUP)  // FIXME: m126 bringup
-  autofill::AutofillProfile* profile = manager->GetProfileByGUID(UnsignedToGUID(id));
+  autofill::AutofillProfile* profile =
+      manager->address_data_manager().GetProfileByGUID(UnsignedToGUID(id));
   if (profile)
-    manager->UpdateProfile(to_Autofill_Profile(ewk_profile));
+    manager->address_data_manager().UpdateProfile(
+        to_Autofill_Profile(ewk_profile));
   else
-    manager->AddProfile(to_Autofill_Profile(ewk_profile));
-#endif
+    manager->address_data_manager().AddProfile(
+        to_Autofill_Profile(ewk_profile));
+
   return EINA_TRUE;
 }
 
@@ -272,9 +275,8 @@ Eina_Bool EwkContextFormAutofillProfileManager::priv_form_autofill_profile_add(
       PersonalDataManagerForEWKContext(ewk_context);
   DCHECK(manager);
 
-#if !defined(EWK_BRINGUP)  // FIXME: m126 bringup
-  manager->AddProfile(to_Autofill_Profile(profile));
-#endif
+  manager->address_data_manager().AddProfile(to_Autofill_Profile(profile));
+
   return EINA_TRUE;
 }