sl@0: #ifndef __TEST_CASE_CONTROLLER_H sl@0: #define __TEST_CASE_CONTROLLER_H sl@0: sl@0: /* 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: * @file TestCaseController.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include "TestCaseFactory.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: // Forward declarations sl@0: sl@0: class CTestEngine; sl@0: class CBasicTestPolicy; sl@0: class CBaseTestCase; sl@0: sl@0: /** sl@0: This class represents the test case state machine for executing the host test cases sl@0: */ sl@0: class CTestCaseController : public CActive sl@0: { sl@0: public: sl@0: /** sl@0: Symbian construction of the controller of the test cases sl@0: @param aTestEngine the test engine for the test application sl@0: @param aHostRole the role for the test controller (i.e. running test cases in host or client mode) sl@0: */ sl@0: sl@0: static CTestCaseController* NewL(CTestEngine& aTestEngine,TBool aHostRole); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: sl@0: ~CTestCaseController(); sl@0: sl@0: protected: // From CActive sl@0: sl@0: /** sl@0: Cancels the task that the this controller is performing sl@0: */ sl@0: sl@0: void DoCancel(); sl@0: sl@0: /** sl@0: Keeps running all specified test cases sl@0: */ sl@0: sl@0: void RunL(); sl@0: sl@0: /** sl@0: Framework error function for RunL sl@0: */ sl@0: sl@0: TInt RunError(TInt aError); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: C++ constructor, build a controller for the test cases sl@0: @param aTestEngine the test engine for the test application sl@0: @param aHostRole the role for the test controller (i.e. running test cases in host or client mode) sl@0: */ sl@0: sl@0: CTestCaseController(CTestEngine& aTestEngine,TBool aHostRole); sl@0: sl@0: /** sl@0: Symbian 2nd phase construction sl@0: */ sl@0: sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: /** sl@0: The test engine sl@0: */ sl@0: CTestEngine& iTestEngine; sl@0: sl@0: /** sl@0: */ sl@0: TBuf iTestCaseId; sl@0: sl@0: /** sl@0: Array of cases results sl@0: */ sl@0: RArray iTestCasesResults; sl@0: sl@0: /** sl@0: The test policy employed for the test cases sl@0: */ sl@0: CBasicTestPolicy* iTestPolicy; sl@0: sl@0: /** sl@0: The role of this controller, whether it runs USB client device test cases sl@0: or USB Host test cases sl@0: */ sl@0: TBool iHostRole; sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif