os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/TestCaseController.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/TestCaseController.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,124 @@
     1.4 +#ifndef __TEST_CASE_CONTROLLER_H
     1.5 +#define __TEST_CASE_CONTROLLER_H
     1.6 +
     1.7 +/*
     1.8 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.9 +* All rights reserved.
    1.10 +* This component and the accompanying materials are made available
    1.11 +* under the terms of the License "Eclipse Public License v1.0"
    1.12 +* which accompanies this distribution, and is available
    1.13 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.14 +*
    1.15 +* Initial Contributors:
    1.16 +* Nokia Corporation - initial contribution.
    1.17 +*
    1.18 +* Contributors:
    1.19 +*
    1.20 +* Description:
    1.21 +* @file TestCaseController.h
    1.22 +* @internalComponent
    1.23 +* 
    1.24 +*
    1.25 +*/
    1.26 +
    1.27 +
    1.28 +
    1.29 +#include <e32base.h>
    1.30 +#include <e32test.h>
    1.31 +#include "TestCaseFactory.h"
    1.32 +
    1.33 +namespace NUnitTesting_USBDI
    1.34 +	{
    1.35 +	
    1.36 +// Forward declarations
    1.37 +
    1.38 +class CTestEngine;
    1.39 +class CBasicTestPolicy;
    1.40 +class CBaseTestCase;
    1.41 +
    1.42 +/**
    1.43 +This class represents the test case state machine for executing the host test cases
    1.44 +*/
    1.45 +class CTestCaseController : public CActive
    1.46 +	{
    1.47 +public:
    1.48 +	/**
    1.49 +	Symbian construction of the controller of the test cases
    1.50 +	@param aTestEngine the test engine for the test application
    1.51 +	@param aHostRole the role for the test controller (i.e. running test cases in host or client mode)
    1.52 +	*/
    1.53 +	
    1.54 +	static CTestCaseController* NewL(CTestEngine& aTestEngine,TBool aHostRole);
    1.55 +	
    1.56 +	/**
    1.57 +	Destructor
    1.58 +	*/
    1.59 +	
    1.60 +	~CTestCaseController();
    1.61 +	
    1.62 +protected: // From CActive
    1.63 +	
    1.64 +	/**
    1.65 +	Cancels the task that the this controller is performing
    1.66 +	*/
    1.67 +	
    1.68 +	void DoCancel();
    1.69 +	
    1.70 +	/**
    1.71 +	Keeps running all specified test cases
    1.72 +	*/
    1.73 +	
    1.74 +	void RunL();
    1.75 +	
    1.76 +	/**
    1.77 +	Framework error function for RunL
    1.78 +	*/
    1.79 +	
    1.80 +	TInt RunError(TInt aError);
    1.81 +	
    1.82 +private:
    1.83 +	
    1.84 +	/**
    1.85 +	C++ constructor, build a controller for the test cases
    1.86 +	@param aTestEngine the test engine for the test application
    1.87 +	@param aHostRole the role for the test controller (i.e. running test cases in host or client mode)
    1.88 +	*/
    1.89 +
    1.90 +	CTestCaseController(CTestEngine& aTestEngine,TBool aHostRole);
    1.91 +	
    1.92 +	/**
    1.93 +	Symbian 2nd phase construction
    1.94 +	*/
    1.95 +	
    1.96 +	void ConstructL();
    1.97 +	
    1.98 +private:
    1.99 +	/**
   1.100 +	The test engine
   1.101 +	*/
   1.102 +	CTestEngine& iTestEngine;
   1.103 +	
   1.104 +	/**
   1.105 +	*/
   1.106 +	TBuf<KTestCaseIdLength> iTestCaseId;
   1.107 +	
   1.108 +	/**
   1.109 +	Array of cases results
   1.110 +	*/
   1.111 +	RArray<TBool> iTestCasesResults;
   1.112 +	
   1.113 +	/**
   1.114 +	The test policy employed for the test cases
   1.115 +	*/
   1.116 +	CBasicTestPolicy* iTestPolicy;
   1.117 +	
   1.118 +	/**
   1.119 +	The role of this controller, whether it runs USB client device test cases
   1.120 +	or USB Host test cases
   1.121 +	*/
   1.122 +	TBool iHostRole;
   1.123 +	};
   1.124 +
   1.125 +	}
   1.126 +
   1.127 +#endif
   1.128 \ No newline at end of file