os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0477.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-0477.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,119 @@
     1.4 +#ifndef __TEST_CASE_PBASE_T_USBDI_0477_H
     1.5 +#define __TEST_CASE_PBASE_T_USBDI_0477_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-0477.h
    1.22 +* @internalComponent
    1.23 +* 
    1.24 +*
    1.25 +*/
    1.26 +
    1.27 +
    1.28 +
    1.29 + 
    1.30 +#include "BaseTestCase.h" 
    1.31 +#include "TestCaseFactory.h"
    1.32 +#include "modelleddevices.h"
    1.33 +#include <d32usbdi.h>
    1.34 +#include <d32usbdi_hubdriver.h>
    1.35 +#include "FDFActor.h"
    1.36 +#include <d32usbc.h>
    1.37 +#include "testdebug.h"
    1.38 +#include "controltransferrequests.h"
    1.39 + 
    1.40 +namespace NUnitTesting_USBDI
    1.41 +	{
    1.42 +
    1.43 +/**
    1.44 +
    1.45 +	
    1.46 +	@SYMTestCaseID				PBASE-T_USBDI-0477
    1.47 +	@SYMTestCaseDesc			Selection of two alternate interface settings where the second selection
    1.48 +								fails and the interface rolls back
    1.49 +	@SYMFssID 
    1.50 +	@SYMPREQ					1782
    1.51 +	@SYMREQ						7046 [USBD : Changing alternate interface setting]
    1.52 +								7047 [USBD : Roll-back of alternate interface setting]
    1.53 +								7048 [USBD : Default Alternate Interface setting]
    1.54 +								7049 [USBD : Establishment of pipes]
    1.55 +								7050 [USBD : Closing of pipes]
    1.56 +	@SYMTestType				UT
    1.57 +	@SYMTestPriority			1 
    1.58 +	@SYMTestActions 			1. Open interfaces on connected device
    1.59 +								2. Open and close a bulk pipe on default setting 0
    1.60 +								3. Select alternate interface setting 1 and establish a pipe then close it
    1.61 +								4. If alternate interface selection fails, establish that the pipe previously 
    1.62 +								   opened in step 2 can be opened again.
    1.63 +	@SYMTestExpectedResults 	Pipes can be established in either interface setting
    1.64 +	@SYMTestStatus				Implemented
    1.65 +	
    1.66 +
    1.67 +*/	
    1.68 +class CUT_PBASE_T_USBDI_0477 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
    1.69 +	{
    1.70 +public:
    1.71 +	static CUT_PBASE_T_USBDI_0477* NewL(TBool aHostRole);
    1.72 +	~CUT_PBASE_T_USBDI_0477(); 
    1.73 +
    1.74 +public: // From MUsbBusObserver
    1.75 +	void DeviceInsertedL(TUint aDeviceHandle);
    1.76 +	void DeviceRemovedL(TUint aDeviceHandle);
    1.77 +	void BusErrorL(TInt aError);
    1.78 +	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
    1.79 +		TInt aCompletionCode);
    1.80 +
    1.81 +public: // From MCommandObserver
    1.82 +	void Ep0TransferCompleteL(TInt aCompletionCode);
    1.83 +	
    1.84 +private:
    1.85 +	CUT_PBASE_T_USBDI_0477(TBool aHostRole);
    1.86 +	void ConstructL();
    1.87 +	void ExecuteHostTestCaseL();
    1.88 +	void ExecuteDeviceTestCaseL();
    1.89 +	void HostDoCancel();
    1.90 +	void DeviceDoCancel();
    1.91 +	void HostRunL();
    1.92 +	void DeviceRunL();
    1.93 +	TBool CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor);
    1.94 +
    1.95 +private:
    1.96 +	enum TCaseStep 
    1.97 +		{
    1.98 +		EInProgress,
    1.99 +		EFailed,
   1.100 +		EPassed
   1.101 +		};
   1.102 +		
   1.103 +	CActorFDF* iActorFDF;
   1.104 +	CEp0Transfer* iClientAction;
   1.105 +	RUsbInterface iUsbInterface0;
   1.106 +	RUsbInterface iUsbInterface1;
   1.107 +	RUsbPipe iTestPipe;
   1.108 +	TCaseStep iCaseStep;
   1.109 +	
   1.110 +	RUsbDeviceA* iTestDevice;
   1.111 +
   1.112 +private:
   1.113 +	/**
   1.114 +	The functor for this test case for the factory
   1.115 +	*/
   1.116 +	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0477,TBool> iFunctor;
   1.117 +	};
   1.118 +
   1.119 +	
   1.120 +	}
   1.121 +
   1.122 +#endif
   1.123 \ No newline at end of file