[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_hit_test_link_title_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 "utc_blink_ewk_hit_test_request_base.h"
6
7 class utc_blink_ewk_hit_test_link_title_get : public utc_blink_ewk_hit_test_request_base {
8 protected:
9   void CheckHitTest(Ewk_Hit_Test* hit_test) override {
10     ASSERT_TRUE(ewk_hit_test_link_title_get(hit_test));
11   }
12
13   void LoadFinished(Evas_Object* webview)
14   {
15     EventLoopStop(utc_blink_ewk_base::Success);
16   }
17
18   static const char* const test_path;
19 };
20
21 const char* const utc_blink_ewk_hit_test_link_title_get::test_path = "/ewk_hit_test/index.html";
22
23 /**
24  * @brief Checking whether the link title of hit element is returned properly.
25  */
26 TEST_F(utc_blink_ewk_hit_test_link_title_get, POS_TEST1)
27 {
28   ASSERT_EQ(EINA_TRUE, ewk_view_url_set(GetEwkWebView(), GetResourceUrl(test_path).c_str()));
29   ASSERT_EQ(Success, EventLoopStart());
30
31   ewk_view_hit_test_request(GetEwkWebView(), 80, 100, EWK_HIT_TEST_MODE_DEFAULT, hit_test_result, this);
32   ASSERT_EQ(Success, EventLoopStart());
33 }
34
35 /**
36  * @brief Checking whether function works properly in case of NULL of a hit test instance.
37  */
38 TEST_F(utc_blink_ewk_hit_test_link_title_get, NEG_TEST1)
39 {
40   utc_check_eq(0, ewk_hit_test_link_title_get(NULL));
41 }