fixes utc_blink_ewk_policy_decision_frame_get unittest
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_view_add_with_context_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 #ifndef NULL
8 #define NULL    0x0
9 #endif
10
11 class utc_blink_ewk_view_add_with_context : public utc_blink_ewk_base
12 {
13 };
14
15 /**
16  * @brief Tests if returns valid webview when called with correct Evas object.
17  */
18 TEST_F(utc_blink_ewk_view_add_with_context, POS_TEST)
19 {
20   Eina_Bool result = EINA_FALSE;
21   Evas_Object* window = elm_win_add(NULL, "TC Launcher", ELM_WIN_BASIC);
22   elm_win_title_set(window, "TC Launcher");
23   Evas* evas = evas_object_evas_get(window);
24
25   /* Initialization of webview */
26   Evas_Object* webview = ewk_view_add_with_context(evas, ewk_context_default_get());
27
28   if( webview)
29     result = EINA_TRUE;
30
31   evas_object_show(webview);
32   evas_object_show(window);
33
34   evas_object_del(webview);
35   evas_object_del(window);
36   utc_check_eq(result, EINA_TRUE);
37 }
38
39 /**
40  * @brief Tests if returns NULL when not called with NULL Evas object.
41  */
42 TEST_F(utc_blink_ewk_view_add_with_context, NEG_TEST1)
43 {
44   Evas_Object* webview = ewk_view_add_with_context(NULL, ewk_context_default_get());
45   if( webview)
46     utc_fail();
47 }
48
49 /**
50  * @brief Tests if returns NULL when not called with NULL Evas object and NULL context.
51  */
52 TEST_F(utc_blink_ewk_view_add_with_context, NEG_TEST2)
53 {
54   Evas_Object* webview = ewk_view_add_with_context(NULL, NULL);
55   if( webview)
56     utc_fail();
57 }