Update contrib.
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".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
15 // Header file: Basic tests.
23 #ifndef TSI_MMFVCLNT_H__
24 #define TSI_MMFVCLNT_H__
34 #include <testframework.h>
38 #include <mmf/common/mmfstandardcustomcommands.h>
39 // *** Jim - added for getting dummy video format uid
40 #include <mda/common/video.h>
42 #include <videoplayer.h>
43 #include <videorecorder.h>
45 // *** Jim - added for getting dummy video controller uid
46 // stolen from CMmfVideoTestControllerUIDs.hrh
47 #define KMmfVideoTestControllerUid 0x101F88D9
49 // Uncomment this line for Jetstream project
50 //#define JETSTREAM_TESTS 1
56 * Global Data used within tests
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;
70 const TInt KMaxBalance = 100;
71 const TInt KMinBalance = -100;
73 const TInt KMaxVolume = 100;
76 * @ MCallbackHandlerObserver, provides an Observer
77 * @ for monitoring callbacks.
79 class MCallbackHandlerObserver
82 virtual void MchoComplete(TInt aID, TInt aError)=0;
87 * CCallbackHandler provides an Observer for
88 * monitoring MVideoPlayerUtilityObserver callbacks.
90 * @class CVideoCallbackHandler
93 class CVideoCallbackHandler : public MVideoPlayerUtilityObserver
96 CVideoCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver);
98 // from MVideoPlayerUtilityObserver
99 virtual void MvpuoOpenComplete(TInt aError);
100 virtual void MvpuoFrameReady(CFbsBitmap& aFrame);
101 virtual void MvpuoPlayComplete(TInt aError);
104 MCallbackHandlerObserver* iMchObserver;
110 * CCallbackHandler provides an Observer for
111 * monitoring MVideoRecorderUtilityObserver callbacks.
113 * @class CVideoRecorderCallbackHandler
116 class CVideoRecorderCallbackHandler : public MVideoRecorderUtilityObserver
119 CVideoRecorderCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver);
122 // MVideoRecorderUtilityObserver
123 virtual void MvruoOpenComplete(TInt aError);
124 virtual void MvruoRecordComplete(TInt aError);
127 MCallbackHandlerObserver* iMchObserver;
134 * CActiveListener provides the asynchronous operation
135 * of an active object
137 * @class CActiveListener
140 class CActiveListener : public CActive
143 CActiveListener() : CActive(CActive::EPriorityIdle) { CActiveScheduler::Add(this); }
144 void InitialiseActiveListener() { iStatus = KRequestPending; SetActive(); }
146 virtual void RunL() { CActiveScheduler::Stop(); }
147 virtual void DoCancel() {};
152 * It's a base class for all test steps.
154 * @class CTestMmfVclntStep
155 * @brief Test class that enables tests.
158 class CTestMmfVclntStep : public CTestStep
162 ~CTestMmfVclntStep();
163 static void CleanUp(TAny *aPtr) ;
164 void SetTestSuite(const CTestSuite* aTestSuite ) { iTestSuite = aTestSuite; }
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();
175 const CTestSuite* iTestSuite ;
176 CActiveScheduler* iActiveScheduler;
178 CWsScreenDevice* iScreen;
183 #endif// TSI_MMFVCLNT_H__