(Automated Tests) Clean up linking
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-event-thread-callback.h
1 #ifndef DALI_TOOLKIT_EVENT_THREAD_CALLBACK_H
2 #define DALI_TOOLKIT_EVENT_THREAD_CALLBACK_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #define DALI_EVENT_THREAD_CALLBACK_H
21
22 // EXTERNAL INCLUDES
23 #include <dali-toolkit/public-api/dali-toolkit-common.h>
24 #include <dali/public-api/signals/callback.h>
25
26 namespace Dali
27 {
28
29 class DALI_TOOLKIT_API EventThreadCallback
30 {
31 public:
32
33   EventThreadCallback( CallbackBase* callback );
34
35   ~EventThreadCallback();
36
37   void Trigger();
38
39   bool WaitingForTrigger();
40
41   CallbackBase* GetCallback();
42
43 private:
44
45   // undefined copy constructor.
46   EventThreadCallback( const EventThreadCallback& );
47
48   // undefined assignment operator
49   EventThreadCallback& operator=( const EventThreadCallback& );
50
51 private:
52
53   struct Impl;
54   Impl* mImpl;
55 };
56
57 }
58
59 namespace Test
60 {
61
62 /**
63  * Wait for the tested code to create an event trigger, then
64  * wait for triggerCount Trigger calls to occur, and execute the trigger
65  * callback afterwards.
66  *
67  * Will wait for a maximum of 30s before failing the test and returning.
68  */
69 bool WaitForEventThreadTrigger( int triggerCount, int timeoutInSeconds=30 );
70
71 }
72
73
74 #endif // DALI_TOOLKIT_EVENT_THREAD_CALLBACK_H