kerneltest/e32test/usbho/t_usbdi/inc/TestCaseController.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 #ifndef __TEST_CASE_CONTROLLER_H
       
     2 #define __TEST_CASE_CONTROLLER_H
       
     3 
       
     4 /*
       
     5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 * All rights reserved.
       
     7 * This component and the accompanying materials are made available
       
     8 * under the terms of the License "Eclipse Public License v1.0"
       
     9 * which accompanies this distribution, and is available
       
    10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 *
       
    12 * Initial Contributors:
       
    13 * Nokia Corporation - initial contribution.
       
    14 *
       
    15 * Contributors:
       
    16 *
       
    17 * Description:
       
    18 * @file TestCaseController.h
       
    19 * @internalComponent
       
    20 * 
       
    21 *
       
    22 */
       
    23 
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <e32test.h>
       
    28 #include "TestCaseFactory.h"
       
    29 
       
    30 namespace NUnitTesting_USBDI
       
    31 	{
       
    32 	
       
    33 // Forward declarations
       
    34 
       
    35 class CTestEngine;
       
    36 class CBasicTestPolicy;
       
    37 class CBaseTestCase;
       
    38 
       
    39 /**
       
    40 This class represents the test case state machine for executing the host test cases
       
    41 */
       
    42 class CTestCaseController : public CActive
       
    43 	{
       
    44 public:
       
    45 	/**
       
    46 	Symbian construction of the controller of the test cases
       
    47 	@param aTestEngine the test engine for the test application
       
    48 	@param aHostRole the role for the test controller (i.e. running test cases in host or client mode)
       
    49 	*/
       
    50 	
       
    51 	static CTestCaseController* NewL(CTestEngine& aTestEngine,TBool aHostRole);
       
    52 	
       
    53 	/**
       
    54 	Destructor
       
    55 	*/
       
    56 	
       
    57 	~CTestCaseController();
       
    58 	
       
    59 protected: // From CActive
       
    60 	
       
    61 	/**
       
    62 	Cancels the task that the this controller is performing
       
    63 	*/
       
    64 	
       
    65 	void DoCancel();
       
    66 	
       
    67 	/**
       
    68 	Keeps running all specified test cases
       
    69 	*/
       
    70 	
       
    71 	void RunL();
       
    72 	
       
    73 	/**
       
    74 	Framework error function for RunL
       
    75 	*/
       
    76 	
       
    77 	TInt RunError(TInt aError);
       
    78 	
       
    79 private:
       
    80 	
       
    81 	/**
       
    82 	C++ constructor, build a controller for the test cases
       
    83 	@param aTestEngine the test engine for the test application
       
    84 	@param aHostRole the role for the test controller (i.e. running test cases in host or client mode)
       
    85 	*/
       
    86 
       
    87 	CTestCaseController(CTestEngine& aTestEngine,TBool aHostRole);
       
    88 	
       
    89 	/**
       
    90 	Symbian 2nd phase construction
       
    91 	*/
       
    92 	
       
    93 	void ConstructL();
       
    94 	
       
    95 private:
       
    96 	/**
       
    97 	The test engine
       
    98 	*/
       
    99 	CTestEngine& iTestEngine;
       
   100 	
       
   101 	/**
       
   102 	*/
       
   103 	TBuf<KTestCaseIdLength> iTestCaseId;
       
   104 	
       
   105 	/**
       
   106 	Array of cases results
       
   107 	*/
       
   108 	RArray<TBool> iTestCasesResults;
       
   109 	
       
   110 	/**
       
   111 	The test policy employed for the test cases
       
   112 	*/
       
   113 	CBasicTestPolicy* iTestPolicy;
       
   114 	
       
   115 	/**
       
   116 	The role of this controller, whether it runs USB client device test cases
       
   117 	or USB Host test cases
       
   118 	*/
       
   119 	TBool iHostRole;
       
   120 	};
       
   121 
       
   122 	}
       
   123 
       
   124 #endif