graphicshwdrivers/surfacemgr/test/inc/tsurfacemanager.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code
       
    20 */
       
    21 
       
    22 #if !defined(__TSURFACEMANAGER_H__)
       
    23 #define __TSURFACEMANAGER_H__
       
    24 
       
    25 #include <test/tgraphicsharness.h>
       
    26 #include <graphics/surface.h>
       
    27 #include <graphics/surfacemanager.h>
       
    28 #include "tsmgmultprocessshared.h"
       
    29 #include "../testdriver/d_sharedchunk.h"
       
    30 
       
    31 class CTSurfaceManager : public CTGraphicsBase
       
    32 	{
       
    33 public:
       
    34 	CTSurfaceManager(CTestStep* aStep);
       
    35 	~CTSurfaceManager();
       
    36 protected:
       
    37 	//from 	CTGraphicsStep
       
    38 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    39 
       
    40 private:
       
    41 	void TestCreateSurfaceNewChunk1L();
       
    42 	void TestCreateSurfaceNewChunk2L();
       
    43 	void TestCreateSurfaceExisitingChunkL();
       
    44 	void TestCreateSurfaceChunkWithHolesL();
       
    45 	void TestCreateSurfaceExisitingChunk2L();
       
    46 	void TestCreateSurfaceExisitingChunk3L();
       
    47 	void TestCreateSurfaceExisitingChunk4L();
       
    48 	void TestCreateSurfaceAssociatedWithHintPairsL();
       
    49 	void TestCreateSurfaceSetReferenceCountL();
       
    50 	void TestSharedChunkClosedL();
       
    51 	void TestMultipleChannelsL();
       
    52 	void TestClosingChannelsL();
       
    53 	void TestSynchronizeCacheL();
       
    54 	void TestSharedChunkClosed2L();
       
    55 	void TestCreateSurfaceInvalidParamsNewChunkL();
       
    56 	void TestCreateSurfaceInvalidParamsExisitingChunkL();
       
    57 	void TestCreateSurfaceInvalidParamsExisitingChunk2L();
       
    58 	void TestInvalidContiguousPropertyL();
       
    59 	void TestInvalidCachePropertyL();
       
    60 	void TestInvalidSharedChunkL();
       
    61 	void TestSynchronizeCacheInvalidParamsL();
       
    62 	void TestCreateSurfaceAlignmentsMemoryTypeL();
       
    63 	void TestOpenSurfaceL();
       
    64 	void TestWriteToTwoBuffersL(); 
       
    65 	void TestQuerySurfaceInfoWithoutMappingL();
       
    66 	void TestQuerySurfaceInfoAfterMappingL();
       
    67 	void TestMapSurfaceL();
       
    68 	void TestClosingSurfaceL();  
       
    69 	void TestClosingSurfaceDecrementsReferenceCountL();
       
    70 	void TestCreateVeryLargeSurfacesL();
       
    71 	void TestSurfaceInfoChangedTypeL();
       
    72 	void TestMapSurfaceInvalidParamsL();
       
    73 	void TestCloseSurfaceInvalidParamsL();
       
    74 	void TestCloseSurfaceSameIDTwiceL();
       
    75 	void TestCreateSurfaceOomL();
       
    76 	void TestGetSurfaceHintInFalseConditionsL();
       
    77 	void TestSetSurfaceHintInFalseConditionsL();
       
    78 	void TestAddSurfaceHintInFalseConditionsL();
       
    79 	void TestGetSurfaceHintL();
       
    80 	void TestSetSurfaceHintL();
       
    81 	void TestAddSurfaceHintL();
       
    82 	void TestDuplicatedHintKeyL();
       
    83 	void TestSurfaceLimitL();
       
    84 	void TestPerformanceOfSurfaceHintAndCacheL();
       
    85 	void TestPerformanceOfSurfaceCreatingAndClosingL();
       
    86 	void TestZerosInHintsArrayL();
       
    87 	void TestCreateSurfaceWithTooManyHintsL();
       
    88 	void TestCreateSurfaceUnMappableL();
       
    89 
       
    90     void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine); 
       
    91 private:
       
    92 	void GetSharedChunkHandleL(RSharedChunkLdd& aDevice, RChunk& aHandle, TUint aChunkSize, TUint aChunkAttribs, TUint aContiguousAttrib);
       
    93 	void SetupAttributesL(RSurfaceManager::TSurfaceCreationAttributes& attributesParams);
       
    94 	void SetAttributesForHintTestL(RSurfaceManager::TSurfaceCreationAttributes& attributesParamsForHintTest);
       
    95 	void SetupAttributesForNegativeTestL(RSurfaceManager::TSurfaceCreationAttributes& attributesForNegativeTest);
       
    96 	void SetAttributesForNegativeHintTestL(RSurfaceManager::TSurfaceCreationAttributes& attributesForNegativeHintTest);
       
    97 	void ChangeAttributes(RSurfaceManager::TSurfaceCreationAttributes* aAttributes, TInt aAlignment, TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers, RSurfaceManager::TCacheAttribute aCacheAttrib);
       
    98 	void SurfaceOperation(RSurfaceManager::TSurfaceCreationAttributesBuf& aAttributes);
       
    99 	void CheckAttributesL(RSurfaceManager::TSurfaceCreationAttributes& aAttributes);
       
   100 	void CheckSizeL(TInt aOffsetToFirstBuffer, TInt aOffsetBetweenBuffers);
       
   101 	void CheckHintPair(TSurfaceId& aSurfaceId, RSurfaceManager::THintPair& aHintPairToCheck, RSurfaceManager::THintPair& aHintPairCompareWith);
       
   102 	void CheckAlignment(TSurfaceId& aId, TInt aAlign, RSurfaceManager::TCacheAttribute aCached);
       
   103 	void ReAllocHintsArrayL(TUint aNumberOfHints);
       
   104 	
       
   105 private:
       
   106 	RSurfaceManager iSurfaceManager;
       
   107 	TSurfaceId iSurfaceId;
       
   108 	RChunk iHandle;
       
   109 	RSurfaceManager::TInfoBuf iInfoBuf;
       
   110 	RSurfaceManager::TSurfaceInfoV01 iInfo;
       
   111 	TInt	iFreq;	
       
   112 	RSurfaceManager::THintPair *iHintsArray;
       
   113 	};
       
   114 
       
   115 
       
   116 class CTSurfaceManagerStep : public CTGraphicsStep
       
   117 	{
       
   118 public:
       
   119 	CTSurfaceManagerStep();
       
   120 protected:	
       
   121 	//from CTGraphicsStep
       
   122 	virtual CTGraphicsBase* CreateTestL();
       
   123 	virtual void TestSetupL();
       
   124 	virtual void TestClose();
       
   125 	};	
       
   126 
       
   127 _LIT(KTSurfaceManagerStep,"TSurfaceManager");
       
   128 
       
   129 #endif