Tizen release 1.0
[pkgs/u/ui-gadget.git] / TC / unit / utc_ApplicationFW_ug_resume_func.c
1 /*
2  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This file is part of the UI Gadget
5  * Written by Jayoun Lee <airjany@samsung.com>, Jinwoo Nam <jwoo.nam@samsung.com>
6  *
7  * PROPRIETARY/CONFIDENTIAL
8  *
9  * This software is the confidential and proprietary information of
10  * SAMSUNG ELECTRONICS (Confidential Information).
11  * You shall not disclose such Confidential Information and shall
12  * use it only in accordance with the terms of the license agreement
13  * you entered into with SAMSUNG ELECTRONICS.  SAMSUNG make no
14  * representations or warranties about the suitability
15  * of the software, either express or implied, including but not
16  * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-
17  * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as
18  * a result of using, modifying or distributing this software or its derivatives.
19  *
20  */
21 #include <tet_api.h>
22 #include <ui-gadget.h>
23 #include <Elementary.h>
24 #include <Ecore_X.h>
25
26 static void startup(void);
27 static void cleanup(void);
28
29 void (*tet_startup)(void) = startup;
30 void (*tet_cleanup)(void) = cleanup;
31
32 static void utc_ApplicationFW_ug_resume_func_01(void);
33
34 enum {
35         POSITIVE_TC_IDX = 0x01,
36 };
37
38 struct tet_testlist tet_testlist[] = {
39         { utc_ApplicationFW_ug_resume_func_01, POSITIVE_TC_IDX },
40         { NULL, 0},
41 };
42
43 #define TESTUG "helloUG-efl"
44 static struct ui_gadget *ug;
45
46 static void startup(void)
47 {
48         char *err;
49         Evas_Object *win;
50
51         elm_init(0, NULL);
52         win = elm_win_add(NULL, "UI gadget test", ELM_WIN_BASIC);
53         if (!win) {
54                 err = "Cannot create window";
55                 goto startup_err;
56         }
57
58         if (UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE)) {
59                 err = "ug_init() failed";
60                 goto startup_err;
61         }
62
63         ug = ug_create(NULL, TESTUG, UG_MODE_FULLVIEW, NULL, NULL);
64         if (!ug) {
65                 err = "ug_create() failed";
66                 goto startup_err;
67         }
68
69         return;
70
71 startup_err:
72         tet_infoline(err);
73         tet_delete(POSITIVE_TC_IDX, err);
74 }
75
76 static void cleanup(void)
77 {
78         elm_shutdown();
79 }
80
81 static Eina_Bool tst01(void *data)
82 {
83         int r = 0;
84
85         r = ug_resume();
86         if (r) {
87                 tet_infoline("ug_resume() failed in positive test case");
88                 tet_result(TET_FAIL);
89                 goto exit;
90         }
91         tet_result(TET_PASS);
92
93 exit:
94         elm_exit();
95         return 0;
96 }
97
98 /**
99  * @brief Positive test case of ug_resume()
100  */
101 static void utc_ApplicationFW_ug_resume_func_01(void)
102 {
103         ecore_idler_add(tst01, NULL);
104         elm_run();
105 }