sl@0: // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H sl@0: #define TGRAPHICSRESOURCEMULTIPROCESSTHREAD_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CTTMSGraphicsStep; sl@0: sl@0: //define default slot for multiprocess communication sl@0: const TInt KSecondProcessFunctionSlot = 1; sl@0: const TInt KSecondProcessParametersSlot = 2; sl@0: sl@0: /** sl@0: * Enums for passing between the test process and the second process used in testing, sl@0: * used to define which test should be run on the second process. sl@0: */ sl@0: enum TSgresTestCase sl@0: { sl@0: ESgresUndefinedTest, sl@0: ESgresSecondProcessOpenImage, sl@0: ESgresSecondProcessOpenDrawable, sl@0: ESgresSecondThreadOpenImage, sl@0: ESgresSecondThreadOpenDrawable, sl@0: ESgresSecondProcessOpenImageInvalid, sl@0: ESgresSecondThreadOpenImageInvalid, sl@0: ESgresSecondThreadOpenDrawableInvalid, sl@0: ESgresSecondProcessOpenDrawableInvalid, sl@0: ESgresSecondThreadPanicDrawableOpenNoDriver, sl@0: ESgresSecondThreadPanicImageOpenNoDriver, sl@0: ESgresSecondThreadPanicImageGetInterfaceInvalidHandle, sl@0: ESgresSecondThreadPanicImageGetInterfaceNoDriver, sl@0: ESgresSecondThreadPanicImageCloseInvalidHandle, sl@0: ESgresSecondThreadPanicImageCloseNoDriver, sl@0: ESgresSecondThreadPanicImageIdInvalidHandle, sl@0: ESgresSecondThreadPanicImageIdNoDriver, sl@0: ESgresSecondThreadPanicImageDrawableTypeNoDriver, sl@0: ESgresSecondThreadPanicImageDrawableTypeInvalidHandle, sl@0: ESgresSecondThreadPanicImageCreateNoDriver1, sl@0: ESgresSecondThreadPanicImageCreateNoDriver2, sl@0: ESgresSecondThreadPanicImageCreateInvalidHandle, sl@0: ESgresSecondThreadPanicImageGetInfoInvalidHandle, sl@0: ESgresSecondThreadPanicImageGetInfoNoDriver, sl@0: ESgresMultipleThreadStressTest, sl@0: ESgresSecondThreadPanicImageGetAttributeInvalidHandle, sl@0: ESgresSecondThreadPanicImageGetAttributeNoDriver, sl@0: ESgresSecondThreadPanicAttributeArrayInvalidIndex, sl@0: ESgresSecondThreadPanicAttributeArrayInvalidIndex2, sl@0: ESgresSecondProcessPanicDriverCloseOpenResources, sl@0: ESgresSecondThreadOpenPassedDriver, sl@0: ESgresSecondThreadClosePassedDriver, sl@0: ESgresSecondThreadCreatePassedImage, sl@0: ESgresSecondThreadOpenPassedImage, sl@0: ESgresSecondThreadClosePassedImage, sl@0: ESgresSecondProcessOpenImageMultithreaded, sl@0: }; sl@0: sl@0: /** sl@0: * Enums for the test results. Used in multi-thread or multi-process tests. sl@0: * Each test function call may contain several sub-tests. Each EXXXTestPassed sl@0: * will be bitwised ored to the test result as each sub-test passes. sl@0: */ sl@0: enum TSgresTestResult sl@0: { sl@0: EFirstTestPassed = 0x00000001, sl@0: ESecondTestPassed = 0x00000002, sl@0: EThirdTestPassed = 0x00000004, sl@0: EFourthTestPassed = 0x00000008, sl@0: EFifthTestPassed = 0x00000010, sl@0: ESixthTestPassed = 0x00000020, sl@0: ESeventhTestPassed = 0x00000040, sl@0: EEighthTestPassed = 0x00000080, sl@0: ENinthTestPassed = 0x00000100, sl@0: ETenthTestPassed = 0x00000200, sl@0: EEleventhTestPassed = 0x00000400, sl@0: ETwelvethTestPassed = 0x00000800, sl@0: EThirteenthTestPassed = 0x00001000, sl@0: EFourteenthTestPassed = 0x00002000, sl@0: EFifteenthTestPassed = 0x00004000, sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Utility class for passing test info between processes. sl@0: */ sl@0: class TSgProcessTestInfo sl@0: { sl@0: public: sl@0: TSgProcessTestInfo() : sl@0: iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest) sl@0: {} sl@0: TSgProcessTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : sl@0: iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase) sl@0: {} sl@0: TSgDrawableId iDrawableId; sl@0: TSgImageInfo iImageInfo; sl@0: TSgresTestCase iTestCase; sl@0: }; sl@0: sl@0: /** sl@0: Utility class for passing test info between threads. sl@0: */ sl@0: class TSgThreadTestInfo sl@0: { sl@0: public: sl@0: TSgThreadTestInfo() : sl@0: iDrawableId(KSgNullDrawableId), iImageInfo(), iTestCase(ESgresUndefinedTest), sl@0: iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) sl@0: {} sl@0: TSgThreadTestInfo(TSgDrawableId aId, const TSgImageInfo& aImageInfo, TSgresTestCase aTestCase) : sl@0: iDrawableId(aId), iImageInfo(aImageInfo), iTestCase(aTestCase), sl@0: iSgDriver(NULL), iSgImage(NULL), iTestStep(NULL) sl@0: {} sl@0: TSgDrawableId iDrawableId; sl@0: TSgImageInfo iImageInfo; sl@0: TSgresTestCase iTestCase; sl@0: RSgDriver* iSgDriver; sl@0: RSgImage* iSgImage; sl@0: CTTMSGraphicsStep* iTestStep; sl@0: }; sl@0: sl@0: // Message queue name for inter-process communication sl@0: _LIT(KSgTestMultiprocessMsgQ, "TestGraphicsResourceMultiprocessMsgQ"); sl@0: sl@0: #endif