sl@0: // Copyright (c) 2007-2009 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 the License "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: // @internalComponent sl@0: // sl@0: // sl@0: sl@0: #ifndef EXAMPLETESTCASE_H sl@0: #define EXAMPLETESTCASE_H sl@0: sl@0: sl@0: sl@0: /** sl@0: @SYMTestCaseID EXAMPLETESTCASE sl@0: @SYMTestCaseDesc Description - shows various test-framework features sl@0: @SYMFssID none sl@0: @SYMPREQ preq# sl@0: @SYMREQ n/a sl@0: @SYMTestType UT sl@0: @SYMTestPriority 1 sl@0: @SYMTestActions 1. Empty step sl@0: 2. Press any key step (with watchdog) sl@0: 3. Another press key step (with watchdog) sl@0: 4. Watchdog cancel function works sl@0: 5. delay step sl@0: 6. Empty step sl@0: 7. End the test sl@0: @SYMTestExpectedResults Example sl@0: @SYMTestStatus Proto sl@0: sl@0: */ sl@0: sl@0: // Example test case: sl@0: // Something to test the Engine with if ever it changes. Verify development changes, and sl@0: // new test-case creation steps here. sl@0: class CExampleTestCase : public CTestCaseRoot sl@0: { sl@0: public: sl@0: static CExampleTestCase* NewL(TBool aHost); sl@0: virtual ~CExampleTestCase(); sl@0: sl@0: void WatchdogExpired(); sl@0: sl@0: virtual void ExecuteTestCaseL(); sl@0: void DoCancel(); sl@0: void RunStepL(); sl@0: sl@0: //override the base-class sl@0: void ProcessKey(TKeyCode &aKey); sl@0: TInt GetStepIndex() { return(iCaseStep); }; sl@0: sl@0: virtual void DescribePreconditions(); sl@0: sl@0: private: sl@0: CExampleTestCase(TBool aHost); sl@0: void ConstructL(); sl@0: sl@0: sl@0: CTestCaseWatchdog *iWDTimer; sl@0: sl@0: // cancel callback methods (not implemented as a 'Mixin) sl@0: static void FuncA(CTestCaseRoot *pThis); sl@0: static void FuncB(CTestCaseRoot *pThis); sl@0: static void FuncC(CTestCaseRoot *pThis); sl@0: sl@0: private: sl@0: sl@0: enum TCaseSteps sl@0: { sl@0: EFirstStep, sl@0: ESecondStep, sl@0: EThirdStep, sl@0: EFourthStep, sl@0: EFifthStep, sl@0: ESixthStep, sl@0: ELastStep sl@0: }; sl@0: sl@0: TCaseSteps iCaseStep; sl@0: sl@0: const static TTestCaseFactoryReceipt iFactoryReceipt; sl@0: sl@0: sl@0: }; sl@0: sl@0: sl@0: #endif // EXAMPLETESTCASE_H