[M120 Migration][MM] Support W3C EME
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / unittest / utc_blink_ewk_context_delete_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_context_delete : public utc_blink_ewk_base
8 {
9 };
10
11 /**
12  * @brief Checkeing whether a Ewk_Context is deleted properly.
13  */
14 TEST_F(utc_blink_ewk_context_delete, POS_TEST1)
15 {
16   Ewk_Context*const context = ewk_context_new();
17   EXPECT_TRUE(NULL!=context);
18   ewk_context_delete(context);
19   // TODO: check context for not exists
20 }
21
22 TEST_F(utc_blink_ewk_context_delete, POS_TEST2)
23 {
24   Ewk_Context*const context = ewk_context_default_get();
25   ASSERT_TRUE(context);
26
27   /*
28    *ewk_context_default_get does not increase refcount of default context.
29    *We need it do manually by ewk_context_ref, because ewk_context_delete
30    *decreases it.
31    */
32   ASSERT_TRUE(NULL!=ewk_context_ref(context));
33   ewk_context_delete(context);
34   EXPECT_EQ(context, ewk_context_default_get());
35 }
36
37 /**
38  * @brief Checking whether function works properly in case of NULL of a context.
39  */
40 TEST_F(utc_blink_ewk_context_delete, NEG_TEST)
41 {
42   ewk_context_delete(NULL);
43 }