1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/vclnt/TSI_MMFVCLNT.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,184 @@
1.4 +
1.5 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// Header file: Basic tests.
1.19 +//
1.20 +//
1.21 +
1.22 +/**
1.23 + @file TSI_MMFVCLNT.h
1.24 +*/
1.25 +
1.26 +#ifndef TSI_MMFVCLNT_H__
1.27 +#define TSI_MMFVCLNT_H__
1.28 +
1.29 +#include <e32base.h>
1.30 +#include <badesca.h>
1.31 +#include <e32test.h>
1.32 +#include <e32keys.h>
1.33 +#include <c32comm.h>
1.34 +#include <f32file.h>
1.35 +#include <etel.h>
1.36 +#include <etelmm.h>
1.37 +#include <testframework.h>
1.38 +
1.39 +#include <fbs.h>
1.40 +#include <w32std.h>
1.41 +#include <mmf/common/mmfstandardcustomcommands.h>
1.42 +// *** Jim - added for getting dummy video format uid
1.43 +#include <mda/common/video.h>
1.44 +
1.45 +#include <videoplayer.h>
1.46 +#include <videorecorder.h>
1.47 +
1.48 +// *** Jim - added for getting dummy video controller uid
1.49 +// stolen from CMmfVideoTestControllerUIDs.hrh
1.50 +#define KMmfVideoTestControllerUid 0x101F88D9
1.51 +
1.52 +// Uncomment this line for Jetstream project
1.53 +//#define JETSTREAM_TESTS 1
1.54 +
1.55 +
1.56 +class CTestSuite ;
1.57 +
1.58 +/**
1.59 + * Global Data used within tests
1.60 + *
1.61 + */
1.62 +
1.63 +const TInt KTwelfthOfSec = 83333;
1.64 +const TInt KTenthOfSec = 100000 ;
1.65 +const TInt KOneSecond = 1000000; // Used in a time out function, 1 second (in microSeconds)
1.66 +const TInt KTenSeconds = 10000000; // Used in a time out function, 10 seconds (in microSeconds)
1.67 +const TInt KFiveSeconds = 5000000; // 5 seconds (in microSeconds)
1.68 +const TInt KFifteenSeconds = 15000000; // 15 seconds (in microSeconds)
1.69 +const TInt KExpectedDeviation = 1500000; // 1.5 second tolerance for timed tests
1.70 +const TInt KNameBufSize = 25;
1.71 +
1.72 +
1.73 +const TInt KMaxBalance = 100;
1.74 +const TInt KMinBalance = -100;
1.75 +
1.76 +const TInt KMaxVolume = 100;
1.77 +
1.78 +/**
1.79 + * @ MCallbackHandlerObserver, provides an Observer
1.80 + * @ for monitoring callbacks.
1.81 + */
1.82 +class MCallbackHandlerObserver
1.83 + {
1.84 +public:
1.85 + virtual void MchoComplete(TInt aID, TInt aError)=0;
1.86 + };
1.87 +
1.88 +
1.89 +/**
1.90 + * CCallbackHandler provides an Observer for
1.91 + * monitoring MVideoPlayerUtilityObserver callbacks.
1.92 + *
1.93 + * @class CVideoCallbackHandler
1.94 + *
1.95 + */
1.96 +class CVideoCallbackHandler : public MVideoPlayerUtilityObserver
1.97 + {
1.98 +public:
1.99 + CVideoCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver);
1.100 + TInt ID();
1.101 + // from MVideoPlayerUtilityObserver
1.102 + virtual void MvpuoOpenComplete(TInt aError);
1.103 + virtual void MvpuoFrameReady(CFbsBitmap& aFrame);
1.104 + virtual void MvpuoPlayComplete(TInt aError);
1.105 +
1.106 +private:
1.107 + MCallbackHandlerObserver* iMchObserver;
1.108 + TInt iID;
1.109 + };
1.110 +
1.111 +
1.112 +/**
1.113 + * CCallbackHandler provides an Observer for
1.114 + * monitoring MVideoRecorderUtilityObserver callbacks.
1.115 + *
1.116 + * @class CVideoRecorderCallbackHandler
1.117 + *
1.118 + */
1.119 +class CVideoRecorderCallbackHandler : public MVideoRecorderUtilityObserver
1.120 + {
1.121 +public:
1.122 + CVideoRecorderCallbackHandler(const TInt aID, MCallbackHandlerObserver* aMchObserver);
1.123 + TInt ID();
1.124 +// const TInt ID();
1.125 + // MVideoRecorderUtilityObserver
1.126 + virtual void MvruoOpenComplete(TInt aError);
1.127 + virtual void MvruoRecordComplete(TInt aError);
1.128 +
1.129 +private:
1.130 + MCallbackHandlerObserver* iMchObserver;
1.131 + TInt iID;
1.132 + };
1.133 +
1.134 +
1.135 +/**
1.136 + *
1.137 + * CActiveListener provides the asynchronous operation
1.138 + * of an active object
1.139 + *
1.140 + * @class CActiveListener
1.141 + *
1.142 + */
1.143 +class CActiveListener : public CActive
1.144 + {
1.145 +public:
1.146 + CActiveListener() : CActive(CActive::EPriorityIdle) { CActiveScheduler::Add(this); }
1.147 + void InitialiseActiveListener() { iStatus = KRequestPending; SetActive(); }
1.148 + // From CActive
1.149 + virtual void RunL() { CActiveScheduler::Stop(); }
1.150 + virtual void DoCancel() {};
1.151 + };
1.152 +
1.153 +
1.154 +/**
1.155 + * It's a base class for all test steps.
1.156 + *
1.157 + * @class CTestMmfVclntStep
1.158 + * @brief Test class that enables tests.
1.159 + *
1.160 + */
1.161 +class CTestMmfVclntStep : public CTestStep
1.162 + {
1.163 +public:
1.164 + CTestMmfVclntStep();
1.165 + ~CTestMmfVclntStep();
1.166 + static void CleanUp(TAny *aPtr) ;
1.167 + void SetTestSuite(const CTestSuite* aTestSuite ) { iTestSuite = aTestSuite; }
1.168 +
1.169 +protected:
1.170 + void WaitWithTimeout(TRequestStatus& aStatus, TInt aNumberOfMicroSeconds);
1.171 + TBool TimeComparison(const TUint aActual, const TUint aExpected, const TUint aDivation);
1.172 + // tests may optionally implement pre- and post-ambles
1.173 + virtual TVerdict DoTestStepPreambleL();
1.174 + virtual TVerdict DoTestStepPostambleL();
1.175 +
1.176 + void InitWservL();
1.177 +protected:
1.178 + const CTestSuite* iTestSuite ;
1.179 + CActiveScheduler* iActiveScheduler;
1.180 +
1.181 + CWsScreenDevice* iScreen;
1.182 + RWindow* iWindow;
1.183 + RWsSession iWs;
1.184 + };
1.185 +
1.186 +#endif// TSI_MMFVCLNT_H__
1.187 +