[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_autofill_profile_data_get_func.cpp
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.
4
5 #include <string>
6
7 #include "utc_blink_ewk_base.h"
8
9 #include "ewk_autofill_profile.h"
10
11 class utc_blink_ewk_autofill_profile_data_get : public utc_blink_ewk_base
12 {
13 protected:
14   utc_blink_ewk_autofill_profile_data_get() : m_profileName("MyProfile")
15   {
16     m_profile = ewk_autofill_profile_new();
17   }
18
19   ~utc_blink_ewk_autofill_profile_data_get() override {
20     ewk_autofill_profile_delete(m_profile);
21   }
22
23   const std::string m_profileName;
24   Ewk_Autofill_Profile* m_profile;
25 };
26
27 TEST_F(utc_blink_ewk_autofill_profile_data_get, POS_TEST)
28 {
29   ASSERT_TRUE(m_profile != NULL);
30
31   ewk_autofill_profile_data_set(m_profile, EWK_PROFILE_NAME,
32       m_profileName.c_str());
33
34   const std::string result(ewk_autofill_profile_data_get(m_profile,
35       EWK_PROFILE_NAME));
36
37   ASSERT_TRUE(result.compare(m_profileName) == 0);
38 }