Adding new test harness
[platform/core/uifw/dali-toolkit.git] / automated-tests / TET / dali-toolkit-test-utils / toolkit-application.h
1 #ifndef __DALI_TOOLKIT_TOOLKIT_APPLICATION_H__
2 #define __DALI_TOOLKIT_TOOLKIT_APPLICATION_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 namespace Dali
21 {
22
23 class Application;
24
25 /**
26  * This creates a stubbed Application so that Application calls work.
27  * Furthermore, it provides an interface to see if certain methods were invoked.
28  */
29 class ToolkitApplication
30 {
31 public: // Construction & Destruction
32
33   ToolkitApplication();
34   ~ToolkitApplication();
35
36 public: // Getters
37
38   Application& GetApplication();
39
40 public: // Signal Emissions
41
42 public: // TEST FUNCTIONS
43
44   // Enumeration of Application methods
45   enum TestFuncEnum
46   {
47   };
48
49   void Reset()
50   {
51     mFunctionsCalled.Reset();
52   }
53
54   bool WasCalled(TestFuncEnum func)
55   {
56     switch(func)
57     {
58     }
59     return false;
60   }
61
62   void ResetCallStatistics(TestFuncEnum func)
63   {
64     switch(func)
65     {
66     }
67   }
68
69 private:
70
71   struct TestFunctions
72   {
73     TestFunctions()
74     {
75     }
76
77     void Reset()
78     {
79     }
80   };
81
82   TestFunctions mFunctionsCalled;
83
84   // The Application Stub
85   Application* mApplicationStub;
86   friend class Application;
87 };
88
89 } // namespace Dali
90
91 #endif // __DALI_TOOLKIT_TOOLKIT_APPLICATION_H__