|
1 |
|
2 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // Header file: Basic tests. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file TSI_MMFVCLNT.h |
|
21 */ |
|
22 |
|
23 #ifndef TSI_MMFVCLNT_H__ |
|
24 #define TSI_MMFVCLNT_H__ |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <badesca.h> |
|
28 #include <e32test.h> |
|
29 #include <e32keys.h> |
|
30 #include <c32comm.h> |
|
31 #include <f32file.h> |
|
32 #include <etel.h> |
|
33 #include <etelmm.h> |
|
34 #include <testframework.h> |
|
35 |
|
36 #include <fbs.h> |
|
37 #include <w32std.h> |
|
38 #include <mmf/common/mmfstandardcustomcommands.h> |
|
39 // *** Jim - added for getting dummy video format uid |
|
40 #include <mda/common/video.h> |
|
41 |
|
42 #include <videoplayer.h> |
|
43 #include <videorecorder.h> |
|
44 |
|
45 // *** Jim - added for getting dummy video controller uid |
|
46 // stolen from CMmfVideoTestControllerUIDs.hrh |
|
47 #define KMmfVideoTestControllerUid 0x101F88D9 |
|
48 |
|
49 // Uncomment this line for Jetstream project |
|
50 //#define JETSTREAM_TESTS 1 |
|
51 |
|
52 |
|
53 class CTestSuite ; |
|
54 |
|
55 /** |
|
56 * Global Data used within tests |
|
57 * |
|
58 */ |
|
59 |
|
60 const TInt KTwelfthOfSec = 83333; |
|
61 const TInt KTenthOfSec = 100000 ; |
|
62 const TInt KOneSecond = 1000000; // Used in a time out function, 1 second (in microSeconds) |
|
63 const TInt KTenSeconds = 10000000; // Used in a time out function, 10 seconds (in microSeconds) |
|
64 const TInt KFiveSeconds = 5000000; // 5 seconds (in microSeconds) |
|
65 const TInt KFifteenSeconds = 15000000; // 15 seconds (in microSeconds) |
|
66 const TInt KExpectedDeviation = 1500000; // 1.5 second tolerance for timed tests |
|
67 const TInt KNameBufSize = 25; |
|
68 |
|
69 |
|
70 const TInt KMaxBalance = 100; |
|
71 const TInt KMinBalance = -100; |
|
72 |
|
73 const TInt KMaxVolume = 100; |
|
74 |
|
75 /** |
|
76 * @ MCallbackHandlerObserver, provides an Observer |
|
77 * @ for monitoring callbacks. |
|
78 */ |
|
79 class MCallbackHandlerObserver |
|
80 { |
|
81 public: |
|
82 virtual void MchoComplete(TInt aID, TInt aError)=0; |
|
83 }; |
|
84 |
|
85 |
|
86 /** |
|
87 * CCallbackHandler provides an Observer for |
|
88 * monitoring MVideoPlayerUtilityObserver callbacks. |
|
89 * |
|
90 * @class CVideoCallbackHandler |
|
91 * |
|
92 */ |
|
93 class CVideoCallbackHandler : public MVideoPlayerUtilityObserver |
|
94 { |
|
95 public: |
|
96 CVideoCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver); |
|
97 TInt ID(); |
|
98 // from MVideoPlayerUtilityObserver |
|
99 virtual void MvpuoOpenComplete(TInt aError); |
|
100 virtual void MvpuoFrameReady(CFbsBitmap& aFrame); |
|
101 virtual void MvpuoPlayComplete(TInt aError); |
|
102 |
|
103 private: |
|
104 MCallbackHandlerObserver* iMchObserver; |
|
105 TInt iID; |
|
106 }; |
|
107 |
|
108 |
|
109 /** |
|
110 * CCallbackHandler provides an Observer for |
|
111 * monitoring MVideoRecorderUtilityObserver callbacks. |
|
112 * |
|
113 * @class CVideoRecorderCallbackHandler |
|
114 * |
|
115 */ |
|
116 class CVideoRecorderCallbackHandler : public MVideoRecorderUtilityObserver |
|
117 { |
|
118 public: |
|
119 CVideoRecorderCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver); |
|
120 TInt ID(); |
|
121 // const TInt ID(); |
|
122 // MVideoRecorderUtilityObserver |
|
123 virtual void MvruoOpenComplete(TInt aError); |
|
124 virtual void MvruoRecordComplete(TInt aError); |
|
125 |
|
126 private: |
|
127 MCallbackHandlerObserver* iMchObserver; |
|
128 TInt iID; |
|
129 }; |
|
130 |
|
131 |
|
132 /** |
|
133 * |
|
134 * CActiveListener provides the asynchronous operation |
|
135 * of an active object |
|
136 * |
|
137 * @class CActiveListener |
|
138 * |
|
139 */ |
|
140 class CActiveListener : public CActive |
|
141 { |
|
142 public: |
|
143 CActiveListener() : CActive(CActive::EPriorityIdle) { CActiveScheduler::Add(this); } |
|
144 void InitialiseActiveListener() { iStatus = KRequestPending; SetActive(); } |
|
145 // From CActive |
|
146 virtual void RunL() { CActiveScheduler::Stop(); } |
|
147 virtual void DoCancel() {}; |
|
148 }; |
|
149 |
|
150 |
|
151 /** |
|
152 * It's a base class for all test steps. |
|
153 * |
|
154 * @class CTestMmfVclntStep |
|
155 * @brief Test class that enables tests. |
|
156 * |
|
157 */ |
|
158 class CTestMmfVclntStep : public CTestStep |
|
159 { |
|
160 public: |
|
161 CTestMmfVclntStep(); |
|
162 ~CTestMmfVclntStep(); |
|
163 static void CleanUp(TAny *aPtr) ; |
|
164 void SetTestSuite(const CTestSuite* aTestSuite ) { iTestSuite = aTestSuite; } |
|
165 |
|
166 protected: |
|
167 void WaitWithTimeout(TRequestStatus& aStatus, TInt aNumberOfMicroSeconds); |
|
168 TBool TimeComparison(const TUint aActual, const TUint aExpected, const TUint aDivation); |
|
169 // tests may optionally implement pre- and post-ambles |
|
170 virtual TVerdict DoTestStepPreambleL(); |
|
171 virtual TVerdict DoTestStepPostambleL(); |
|
172 |
|
173 void InitWservL(); |
|
174 protected: |
|
175 const CTestSuite* iTestSuite ; |
|
176 CActiveScheduler* iActiveScheduler; |
|
177 |
|
178 CWsScreenDevice* iScreen; |
|
179 RWindow* iWindow; |
|
180 RWsSession iWs; |
|
181 }; |
|
182 |
|
183 #endif// TSI_MMFVCLNT_H__ |
|
184 |