os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-1236.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/PBASE-T_USBDI-1236.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,116 @@
     1.4 +#ifndef __TEST_CASE_PBASE_T_USBDI_1236_H
     1.5 +#define __TEST_CASE_PBASE_T_USBDI_1236_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 PBASE-T_USBDI-1236.h
    1.22 +* @internalComponent
    1.23 +*
    1.24 +*/
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +#include "BaseTestCase.h"
    1.30 +#include "TestCaseFactory.h"
    1.31 +#include <d32usbdi.h>
    1.32 +#include <d32usbdi_hubdriver.h>
    1.33 +#include "FDFActor.h"
    1.34 +#include "modelleddevices.h"
    1.35 +#include "controltransferrequests.h"
    1.36 +
    1.37 +namespace NUnitTesting_USBDI
    1.38 +	{
    1.39 +
    1.40 +/**
    1.41 +
    1.42 +	
    1.43 +	@SYMTestCaseID				PBASE-T_USBDI-1236
    1.44 +	@SYMTestCaseDesc			Get Interface description string
    1.45 +	@SYMFssID 
    1.46 +	@SYMPREQ					1782
    1.47 +	@SYMREQ						7074 [USBD : Device suspension]
    1.48 +								7075 [USBD : Device suspension: multiple interfaces]
    1.49 +								7076 [USBD : Device resume]
    1.50 +								7077 [USBD : Remote wakeup]
    1.51 +								7078 [USBD : Suspend following a wake up]
    1.52 +	@SYMTestType				UT
    1.53 +	@SYMTestPriority			1 
    1.54 +	@SYMTestActions 			1. Suspend a connected device through its interfaces
    1.55 +								2. Resume a interface
    1.56 +								3. Once device is resumed, enable remote wake-up and suspend all interfaces again 
    1.57 +								4. Remote wake up device
    1.58 +								5. Following a remote wake-up, suspend device again
    1.59 +	@SYMTestExpectedResults 	Correct suspension and device resumption can be established
    1.60 +	@SYMTestStatus				Implemented
    1.61 +	
    1.62 +
    1.63 +*/	
    1.64 +class CUT_PBASE_T_USBDI_1236 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
    1.65 +	{
    1.66 +public:
    1.67 +	static CUT_PBASE_T_USBDI_1236* NewL(TBool aHostRole);
    1.68 +	~CUT_PBASE_T_USBDI_1236(); 
    1.69 +
    1.70 +private: 
    1.71 +	enum TCaseSteps
    1.72 +		{
    1.73 +		EStepGetInterfaceString,
    1.74 +		EPassed,
    1.75 +		EFailed
    1.76 +		};
    1.77 +
    1.78 +public: // From MUsbBusObserver
    1.79 +	void DeviceInsertedL(TUint aDeviceHandle);
    1.80 +	void DeviceRemovedL(TUint aDeviceHandle);
    1.81 +	void BusErrorL(TInt aError);
    1.82 +	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
    1.83 +		TInt aCompletionCode);
    1.84 +	
    1.85 +public: // From MCommandObserver
    1.86 +	void Ep0TransferCompleteL(TInt aCompletionCode);
    1.87 +
    1.88 +private:
    1.89 +	CUT_PBASE_T_USBDI_1236(TBool aHostRole);
    1.90 +	void ConstructL();
    1.91 +	void ExecuteHostTestCaseL();
    1.92 +	void ExecuteDeviceTestCaseL();
    1.93 +	void HostDoCancel();
    1.94 +	void DeviceDoCancel();
    1.95 +	void HostRunL();
    1.96 +	void DeviceRunL();
    1.97 +
    1.98 +private:
    1.99 +
   1.100 +	CActorFDF* iActorFDF;
   1.101 +	CEp0Transfer* iControlEp0;
   1.102 +	RUsbInterface iUsbInterface0;
   1.103 +	RUsbInterface iUsbInterface1;
   1.104 +	TUint iDeviceHandle;
   1.105 +
   1.106 +	TCaseSteps iCaseStep;
   1.107 +	
   1.108 +	RUsbDeviceA* iTestDevice;
   1.109 +	
   1.110 +private:
   1.111 +	/**
   1.112 +	The functor for this test case for the factory
   1.113 +	*/
   1.114 +	const static TFunctorTestCase<CUT_PBASE_T_USBDI_1236,TBool> iFunctor;
   1.115 +	};
   1.116 +
   1.117 +	}
   1.118 +	
   1.119 +#endif