fixup! TC utc_blink_ewk_view_app_name_user_agent_set_func refactoring.
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_hit_test_image_file_name_extension_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_base.h"
6
7 class utc_blink_ewk_hit_test_image_file_name_extension_get : public utc_blink_ewk_base {
8 protected:
9   void LoadFinished(Evas_Object* webview)
10   {
11     EventLoopStop(utc_blink_ewk_base::Success);
12   }
13
14   static const char* const test_path;
15 };
16
17 const char* const utc_blink_ewk_hit_test_image_file_name_extension_get::test_path = "/ewk_hit_test/index.html";
18
19 /**
20  * @brief Checking whether the image fiile name extension of hit element is returned properly.
21  */
22 TEST_F(utc_blink_ewk_hit_test_image_file_name_extension_get, POS_TEST1)
23 {
24   Eina_Bool result = ewk_view_url_set(GetEwkWebView(), GetResourceUrl(test_path).c_str());
25   if (!result)
26     utc_fail();
27   utc_blink_ewk_base::MainLoopResult loop_result = EventLoopStart();
28
29   if (loop_result != utc_blink_ewk_base::Success) {
30     utc_fail();
31   }
32
33   Ewk_Hit_Test* hit_test = ewk_view_hit_test_new(GetEwkWebView(), 200, 200, EWK_HIT_TEST_MODE_IMAGE_DATA);
34   if (ewk_hit_test_image_file_name_extension_get(hit_test))
35     result = EINA_TRUE;
36   else
37     result = EINA_FALSE;
38
39   ewk_hit_test_free(hit_test);
40   utc_check_eq(result, EINA_TRUE);
41 }
42
43 /**
44  * @brief Checking whether function works properly in case of NULL of a hit test instance.
45  */
46 TEST_F(utc_blink_ewk_hit_test_image_file_name_extension_get, NEG_TEST1)
47 {
48   utc_check_eq(0, ewk_hit_test_image_file_name_extension_get(NULL));
49 }