1 // Copyright 2014 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "utc_blink_ewk_base.h"
6 #include "utc_blink_ewk_context_form_autofill_profile_utils.h"
11 class utc_blink_ewk_context_form_autofill_profile_get_all
12 : public utc_blink_ewk_context_form_autofill_profile_base {
15 TEST_F(utc_blink_ewk_context_form_autofill_profile_get_all, POS_TEST)
17 Ewk_Autofill_Profile* profile = getTestEwkAutofillProfile();
18 ASSERT_TRUE(NULL != profile);
19 Eina_Bool result = ewk_context_form_autofill_profile_add(
20 ewk_context_default_get(), profile);
21 ewk_autofill_profile_delete(profile);
23 ASSERT_TRUE(EINA_FALSE != result);
24 Eina_List* profilesList = ewk_context_form_autofill_profile_get_all(
25 ewk_context_default_get());
26 ASSERT_TRUE (NULL != profilesList);
30 EINA_LIST_FOREACH(profilesList, l, data)
32 Ewk_Autofill_Profile* tmp_profile = static_cast<Ewk_Autofill_Profile*>(data);
33 if (NULL != tmp_profile) {
34 if (TEST_AUTOFILL_PROFILE_ID == ewk_autofill_profile_id_get(tmp_profile)) {
35 utc_message("found proper profile ID");
36 profile = tmp_profile;
38 ewk_autofill_profile_delete(tmp_profile);
43 EXPECT_TRUE(checkIfProfileContainsTestData(profile));
44 ewk_autofill_profile_delete(profile);
48 TEST_F(utc_blink_ewk_context_form_autofill_profile_get_all, NEG_TEST)
50 ASSERT_EQ(NULL, ewk_context_form_autofill_profile_get_all(NULL));