os/mm/mmlibs/mmfw/tsrc/mmfunittest/videorenderer/inc/testrendererneg.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef TESTRENDERERNEG_H
    17 #define TESTRENDERERNEG_H
    18 
    19 // INCLUDES
    20 #include "testrenderer.h"
    21 
    22 /* 
    23 Test creating surface with different parameters
    24 MM-MMF-VIDREND-U-0100 to MM-MMF-VIDREND-U-0107
    25 */
    26 class RTestRendererCreateSurfaceStep : public RTestRendererStep
    27 	{
    28 public:
    29 	static RTestRendererCreateSurfaceStep* NewL(const TDesC& aStepName, 
    30 													TInt aExpectedError, 
    31 													TRgbFormat aRgbFormat, 
    32 													TSize aSize, 
    33 													TInt aNumBuffers);
    34 
    35 protected:
    36 	RTestRendererCreateSurfaceStep(const TDesC& aStepName,
    37 									TInt aExpectedError, 
    38 									TRgbFormat aRgbFormat, 
    39 									TSize aSize, 
    40 									TInt aNumBuffers);
    41     TVerdict DoTestStepL();
    42 	virtual void FsmL(TTestRendererEvents /*aEventCode*/) {};
    43     
    44 private:
    45 	TInt iExpectedError;
    46 	TInt iNumBuffers;
    47 	TInt iDisplayId;
    48 	};
    49 
    50 /* 
    51 Test update buffer twice in timed and non-timed mode
    52 This test case is run by different script for udeb and urel mode to expect different behaviour
    53 MM-MMF-VIDREND-U-0108 and MM-MMF-VIDREND-U-0109
    54 */
    55 class RTestRendererUpdateTwiceStep : public RTestRendererStep
    56 	{
    57 public:
    58 	static RTestRendererUpdateTwiceStep* NewL(const TDesC& aStepName, TBool aTimed);
    59 
    60 protected:
    61 	RTestRendererUpdateTwiceStep(const TDesC& aStepName, TBool aTimed);
    62 	void FsmL(TTestRendererEvents aEventCode);
    63 	};
    64 
    65 /*
    66 Test release buffer twice
    67 This class is also base class for test steps that do not need to start active scheduler
    68 MM-MMF-VIDREND-U-0110
    69 */
    70 class RTestRendererReleaseTwiceStep : public RTestRendererStep
    71 	{
    72 public:
    73 	static RTestRendererReleaseTwiceStep* NewL(const TDesC& aStepName, TBool aTimed);
    74 
    75 protected:
    76 	RTestRendererReleaseTwiceStep(const TDesC& aStepName, TBool aTimed);
    77 	void FsmL(TTestRendererEvents aEventCode);
    78 	TVerdict DoTestStepL();
    79 	
    80 protected:
    81 	TVideoFrameBuffer* iBuffer;
    82 	};
    83 
    84 /*
    85 Test using surface after destroying surface
    86 MM-MMF-VIDREND-U-0111
    87 */
    88 class RTestRendererDestroySurfaceStep : public RTestRendererReleaseTwiceStep
    89 	{
    90 public:
    91 	static RTestRendererDestroySurfaceStep* NewL(const TDesC& aStepName, TBool aTimed);
    92 
    93 protected:
    94 	RTestRendererDestroySurfaceStep(const TDesC& aStepName, TBool aTimed);
    95 	void FsmL(TTestRendererEvents aEventCode);
    96 	};
    97 
    98 /* 
    99 Test update buffer immediately destroy surface in timed and non-timed mode
   100 MM-MMF-VIDREND-U-0112 and MM-MMF-VIDREND-U-0113
   101 */
   102 class RTestRendererUpdateAndDestroyStep : public RTestRendererStep
   103 	{
   104 public:
   105 	static RTestRendererUpdateAndDestroyStep* NewL(const TDesC& aStepName, TBool aTimed);
   106 	static TInt TimerCallbackFunc(TAny *aPtr);
   107 	void FsmL(TTestRendererEvents aEventCode);
   108 
   109 protected:
   110 	RTestRendererUpdateAndDestroyStep(const TDesC& aStepName, TBool aTimed);
   111     TVerdict DoTestStepPreambleL();
   112     TVerdict DoTestStepPostambleL();
   113 	
   114 protected:
   115 	CCallBackTimer* iCallbackTimer;
   116 	};
   117 
   118 /* 
   119 Test update buffer immediately delete video renderer in timed and non-timed mode
   120 MM-MMF-VIDREND-U-0114 and MM-MMF-VIDREND-U-0115
   121 */
   122 class RTestRendererUpdateAndDeleteStep : public RTestRendererReleaseTwiceStep
   123 	{
   124 public:
   125 	static RTestRendererUpdateAndDeleteStep* NewL(const TDesC& aStepName, TBool aTimed);
   126 
   127 protected:
   128 	RTestRendererUpdateAndDeleteStep(const TDesC& aStepName, TBool aTimed);
   129 	void FsmL(TTestRendererEvents aEventCode);
   130 	};
   131 
   132 /* 
   133 Test update buffer with invalid buffer in timed and non-timed mode
   134 MM-MMF-VIDREND-U-0116 and MM-MMF-VIDREND-U-0117
   135 */
   136 class RTestRendererUpdateInvalidStep : public RTestRendererReleaseTwiceStep
   137 	{
   138 public:
   139 	static RTestRendererUpdateInvalidStep* NewL(const TDesC& aStepName, TBool aTimed);
   140 
   141 protected:
   142 	RTestRendererUpdateInvalidStep(const TDesC& aStepName, TBool aTimed);
   143 	void FsmL(TTestRendererEvents aEventCode);
   144 	};
   145 
   146 /* 
   147 Test creating surface twice
   148 MM-MMF-VIDREND-U-0118
   149 */
   150 class RTestRendererCreateTwiceStep : public RTestRendererReleaseTwiceStep
   151 	{
   152 public:
   153 	static RTestRendererCreateTwiceStep* NewL(const TDesC& aStepName, TBool aTimed);
   154 
   155 protected:
   156 	RTestRendererCreateTwiceStep(const TDesC& aStepName, TBool aTimed);
   157 	void FsmL(TTestRendererEvents aEventCode);
   158 	};
   159 
   160 /* 
   161 Test destroying surface that does not exist
   162 MM-MMF-VIDREND-U-0119
   163 */
   164 class RTestRendererDestroyInvalidStep : public RTestRendererReleaseTwiceStep
   165 	{
   166 public:
   167 	static RTestRendererDestroyInvalidStep* NewL(const TDesC& aStepName, TBool aTimed);
   168 
   169 protected:
   170 	RTestRendererDestroyInvalidStep(const TDesC& aStepName, TBool aTimed);
   171 	void FsmL(TTestRendererEvents aEventCode);
   172 	};
   173 
   174 /* 
   175 Test resoure file reader
   176 MM-MMF-VIDREND-U-0120
   177 */
   178 class RTestResourceFileReaderStep : public RTestStep
   179 	{
   180 public:
   181 	static RTestResourceFileReaderStep* NewL(const TDesC& aStepName, 
   182 												const TDesC& aFileName, 
   183 												TInt aExpectedFormatErr, 
   184 												TInt aExpectedTimerErr, 
   185 												TInt64 aExpectedDefaultDelay, 
   186 												TInt64 aExpectedDelay);
   187 
   188 protected:
   189 	TVerdict DoTestStepL();
   190 
   191 private:
   192 	RTestResourceFileReaderStep(const TDesC& aStepName, 
   193 								const TDesC& aFileName, 
   194 								TInt aExpectedFormatErr, 
   195 								TInt aExpectedTimerErr, 
   196 								TInt64 aExpectedDefaultDelay, 
   197 								TInt64 aExpectedDelay);
   198 	TBuf<KMaxFileName> iFileName;
   199 	TInt iExpectedFormatErr;
   200 	TInt iExpectedTimerErr;
   201 	TInt64 iExpectedDefaultDelay;
   202 	TInt64 iExpectedMaxDelay;
   203 	};
   204 
   205 /* 
   206 Test creating a delay by delaying set background surface in timed mode
   207 MM-MMF-VIDREND-U-0121
   208 */
   209 class RTestRendererDelayStep : public RTestRendererUpdateAndDestroyStep
   210 	{
   211 public:
   212 	static RTestRendererDelayStep* NewL(const TDesC& aStepName);
   213 	void FsmL(TTestRendererEvents aEventCode);
   214 
   215 protected:
   216 	RTestRendererDelayStep(const TDesC& aStepName);
   217 	};
   218 
   219 #endif // TESTRENDERERNEG_H