os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestStepDevVideoAllocFailNew.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestStepDevVideoAllocFailNew.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,228 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Header file: DevVideo alloc tests.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file TestStepDevVideoAllocFailNew.h
    1.23 +*/
    1.24 +
    1.25 +#ifndef __TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__
    1.26 +#define __TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__
    1.27 +
    1.28 +#include "TestDevVideoPlay.h"
    1.29 +#include "TestDevVideoRecord.h"
    1.30 +
    1.31 +/**
    1.32 + * DevVideoPlay alloc test base class
    1.33 + *
    1.34 + * @class CTestStepDevVideoPlayAllocFail
    1.35 + *
    1.36 + * Req. under test REQ1931.3
    1.37 + */
    1.38 +
    1.39 +// inherits from CTestDevVideoStep because CTestDevVideoPlayStep instantiates
    1.40 +// the CMMFDevVideoPlay class which we want to do ourselves
    1.41 +class CTestStepDevVideoPlayAllocFail : public CTestDevVideoStep, public MMMFDevVideoPlayObserver
    1.42 +	{
    1.43 +public:
    1.44 +	static CTestStepDevVideoPlayAllocFail* NewL(const TDesC& aTestName);
    1.45 +	CTestStepDevVideoPlayAllocFail(const TDesC& aTestName);
    1.46 +	~CTestStepDevVideoPlayAllocFail();
    1.47 +	virtual TVerdict DoTestStepL();
    1.48 +	virtual TVerdict DoTestL() = 0;
    1.49 +
    1.50 +	// MMMFDevVideoPlayObserver
    1.51 +    virtual void MdvpoNewBuffers();
    1.52 +    virtual void MdvpoReturnPicture(TVideoPicture* aPicture);
    1.53 +    virtual void MdvpoSupplementalInformation(const TDesC8& aData, 
    1.54 +											  const TTimeIntervalMicroSeconds& aTimestamp, 
    1.55 +											  const TPictureId& aPictureId);
    1.56 +	virtual void MdvpoPictureLoss();
    1.57 +	virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures);
    1.58 +	virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
    1.59 +	virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData);
    1.60 +    virtual void MdvpoTimedSnapshotComplete(TInt aError, 
    1.61 +											TPictureData* aPictureData, 
    1.62 +											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
    1.63 +											const TPictureId& aPictureId);
    1.64 +    virtual void MdvpoNewPictures();
    1.65 +    virtual void MdvpoFatalError(TInt aError);
    1.66 +    virtual void MdvpoInitComplete(TInt aError);
    1.67 +    virtual void MdvpoStreamEnd();
    1.68 +
    1.69 +protected:
    1.70 +	TInt iError;
    1.71 +	CMMFDevVideoPlay* iDevVideoPlay;
    1.72 +	};
    1.73 +
    1.74 +
    1.75 +
    1.76 +class CTestStepDevVideoPlayAllocFailNew : public CTestStepDevVideoPlayAllocFail
    1.77 +	{
    1.78 +public:
    1.79 +	static CTestStepDevVideoPlayAllocFailNew* NewL(const TDesC& aTestName);
    1.80 +	CTestStepDevVideoPlayAllocFailNew(const TDesC& aTestName);
    1.81 +	~CTestStepDevVideoPlayAllocFailNew();
    1.82 +	virtual TVerdict DoTestL();
    1.83 +	};
    1.84 +
    1.85 +
    1.86 +class CTestStepDevVideoPlayAllocFailFindPlugins : public CTestStepDevVideoPlayAllocFail
    1.87 +	{
    1.88 +public:
    1.89 +	static CTestStepDevVideoPlayAllocFailFindPlugins* NewL(const TDesC& aTestName);
    1.90 +	CTestStepDevVideoPlayAllocFailFindPlugins(const TDesC& aTestName);
    1.91 +	~CTestStepDevVideoPlayAllocFailFindPlugins();
    1.92 +	virtual TVerdict DoTestL();
    1.93 +private:
    1.94 +	void GetDecodersL();
    1.95 +	void GetPostProcessorsL();
    1.96 +	void FindDecodersL();
    1.97 +	void FindPostProcessorsL();
    1.98 +	void CheckPluginsL(const RArray<TUid>& aFoundPlugins, const RArray<TUid>& aExpectedPlugins, const RArray<TUid>& aUnExpectedPlugins);
    1.99 +	};
   1.100 +
   1.101 +class CTestStepDevVideoPlayAllocFailInfoDecoder : public CTestStepDevVideoPlayAllocFail
   1.102 +	{
   1.103 +public:
   1.104 +	static CTestStepDevVideoPlayAllocFailInfoDecoder* NewL(const TDesC& aTestName);
   1.105 +	CTestStepDevVideoPlayAllocFailInfoDecoder(const TDesC& aTestName);
   1.106 +	~CTestStepDevVideoPlayAllocFailInfoDecoder();
   1.107 +	virtual TVerdict DoTestL();
   1.108 +	};
   1.109 +
   1.110 +class CTestStepDevVideoPlayAllocFailInfoPostProc : public CTestStepDevVideoPlayAllocFail
   1.111 +	{
   1.112 +public:
   1.113 +	static CTestStepDevVideoPlayAllocFailInfoPostProc* NewL(const TDesC& aTestName);
   1.114 +	CTestStepDevVideoPlayAllocFailInfoPostProc(const TDesC& aTestName);
   1.115 +	~CTestStepDevVideoPlayAllocFailInfoPostProc();
   1.116 +	virtual TVerdict DoTestL();
   1.117 +	};
   1.118 +
   1.119 +class CTestStepDevVideoPlayAllocFailGetPictures : public CTestStepDevVideoPlayAllocFail
   1.120 +	{
   1.121 +public:
   1.122 +	static CTestStepDevVideoPlayAllocFailGetPictures* NewL(const TDesC& aTestName);
   1.123 +	CTestStepDevVideoPlayAllocFailGetPictures(const TDesC& aTestName);
   1.124 +	~CTestStepDevVideoPlayAllocFailGetPictures();
   1.125 +	virtual TVerdict DoTestL();
   1.126 +	void PerformTestL();
   1.127 +	virtual void MdvpoInitComplete(TInt aError);
   1.128 +    virtual void MdvpoNewPictures();
   1.129 +	void CheckNewPictureInfoL(TUint aNumPictures, const TTimeIntervalMicroSeconds& aFirst, const TTimeIntervalMicroSeconds& aLast);
   1.130 +	void DoNewPicturesL();
   1.131 +private:
   1.132 +	TInt iCurrentPictureNumber;
   1.133 +	TInt iTestError;
   1.134 +	};
   1.135 +
   1.136 +
   1.137 +// DEVVIDEORECORD //
   1.138 +
   1.139 +/**
   1.140 + * DevVideoRecord alloc test base class
   1.141 + *
   1.142 + * @class CTestStepDevVideoRecordAllocFail
   1.143 + *
   1.144 + * Req. under test REQ1931.3
   1.145 + */
   1.146 +
   1.147 +// inherits from CTestDevVideoStep because CTestDevVideoRecordStep instantiates
   1.148 +// the CMMFDevVideoRecord class which we want to do ourselves
   1.149 +class CTestStepDevVideoRecordAllocFail : public CTestDevVideoStep, public MMMFDevVideoRecordObserver
   1.150 +	{
   1.151 +public:
   1.152 +	static CTestStepDevVideoRecordAllocFail* NewL(const TDesC& aTestName);
   1.153 +	CTestStepDevVideoRecordAllocFail(const TDesC& aTestName);
   1.154 +	~CTestStepDevVideoRecordAllocFail();
   1.155 +	virtual TVerdict DoTestStepL();
   1.156 +	virtual TVerdict DoTestL() = 0;
   1.157 +
   1.158 +	// MMMFDevVideoRecordObserver
   1.159 +    virtual void MdvroReturnPicture(TVideoPicture* aPicture);
   1.160 +    virtual void MdvroSupplementalInfoSent();
   1.161 +    virtual void MdvroNewBuffers();
   1.162 +    virtual void MdvroFatalError(TInt aError);
   1.163 +    virtual void MdvroInitializeComplete(TInt aError);
   1.164 +    virtual void MdvroStreamEnd();
   1.165 +
   1.166 +protected:
   1.167 +	TInt iError;
   1.168 +	CMMFDevVideoRecord* iDevVideoRecord;
   1.169 +	};
   1.170 +
   1.171 +
   1.172 +class CTestStepDevVideoRecordAllocFailNew : public CTestStepDevVideoRecordAllocFail
   1.173 +	{
   1.174 +public:
   1.175 +	static CTestStepDevVideoRecordAllocFailNew* NewL(const TDesC& aTestName);
   1.176 +	CTestStepDevVideoRecordAllocFailNew(const TDesC& aTestName);
   1.177 +	~CTestStepDevVideoRecordAllocFailNew();
   1.178 +	virtual TVerdict DoTestL();
   1.179 +	};
   1.180 +
   1.181 +class CTestStepDevVideoRecordAllocFailInfoEncoder : public CTestStepDevVideoRecordAllocFail
   1.182 +	{
   1.183 +public:
   1.184 +	static CTestStepDevVideoRecordAllocFailInfoEncoder* NewL(const TDesC& aTestName);
   1.185 +	CTestStepDevVideoRecordAllocFailInfoEncoder(const TDesC& aTestName);
   1.186 +	~CTestStepDevVideoRecordAllocFailInfoEncoder();
   1.187 +	virtual TVerdict DoTestL();
   1.188 +	};
   1.189 +
   1.190 +class CTestStepDevVideoRecordAllocFailInfoPreProc : public CTestStepDevVideoRecordAllocFail
   1.191 +	{
   1.192 +public:
   1.193 +	static CTestStepDevVideoRecordAllocFailInfoPreProc* NewL(const TDesC& aTestName);
   1.194 +	CTestStepDevVideoRecordAllocFailInfoPreProc(const TDesC& aTestName);
   1.195 +	~CTestStepDevVideoRecordAllocFailInfoPreProc();
   1.196 +	virtual TVerdict DoTestL();
   1.197 +	};
   1.198 +
   1.199 +class CTestStepDevVideoRecordAllocFailFindPlugins : public CTestStepDevVideoRecordAllocFail
   1.200 +	{
   1.201 +public:
   1.202 +	static CTestStepDevVideoRecordAllocFailFindPlugins* NewL(const TDesC& aTestName);
   1.203 +	CTestStepDevVideoRecordAllocFailFindPlugins(const TDesC& aTestName);
   1.204 +	~CTestStepDevVideoRecordAllocFailFindPlugins();
   1.205 +	virtual TVerdict DoTestL();
   1.206 +private:
   1.207 +	void GetEncodersL();
   1.208 +	void GetPreProcessorsL();
   1.209 +	void FindEncodersL();
   1.210 +	void FindPreProcessorsL();
   1.211 +	void CheckPluginsL(const RArray<TUid>& aFoundPlugins, const RArray<TUid>& aExpectedPlugins, const RArray<TUid>& aUnExpectedPlugins);
   1.212 +	};
   1.213 +
   1.214 +class CTestStepDevVideoRecordAllocFailGetBuffers : public CTestStepDevVideoRecordAllocFail
   1.215 +	{
   1.216 +public:
   1.217 +	static CTestStepDevVideoRecordAllocFailGetBuffers* NewL(const TDesC& aTestName);
   1.218 +	CTestStepDevVideoRecordAllocFailGetBuffers(const TDesC& aTestName);
   1.219 +	~CTestStepDevVideoRecordAllocFailGetBuffers();
   1.220 +	virtual TVerdict DoTestL();
   1.221 +	void PerformTestL();
   1.222 +	virtual void MdvpoInitComplete(TInt aError);
   1.223 +    virtual void MdvpoNewBuffers();
   1.224 +	void CheckNewBufferInfoL(TUint aNumBuffers);
   1.225 +	void DoNewBuffersL();
   1.226 +private:
   1.227 +	TInt iCurrentBufferNumber;
   1.228 +	TInt iTestError;
   1.229 +	};
   1.230 +
   1.231 +#endif //(__TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__)