os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0489.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 #ifndef __TEST_CASE_PBASE_T_USBDI_0489_H
     2 #define __TEST_CASE_PBASE_T_USBDI_0489_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 PBASE-T_USBDI-0489.h
    19 * @internalComponent
    20 * 
    21 *
    22 */
    23 
    24 
    25 
    26  
    27 #include "BaseTestCase.h"
    28 #include "TestCaseFactory.h"
    29 #include "FDFActor.h"
    30 #include "modelleddevices.h"
    31 #include "controltransferrequests.h"
    32 #include <d32usbc.h>
    33 #include "testdebug.h"
    34 
    35 namespace NUnitTesting_USBDI
    36 	{
    37 
    38 /**
    39 
    40 	
    41 	@SYMTestCaseID				PBASE-T_USBDI-0489
    42 	@SYMTestCaseDesc			
    43 	@SYMFssID 
    44 	@SYMPREQ					1782
    45 	@SYMREQ						
    46 	@SYMTestType				UT
    47 	@SYMTestPriority			1 
    48 	@SYMTestActions 			1. Open interface on connected device
    49 								2. Send a control transfer request that is NAK'd by the USB device
    50 								3. Cancel the outstanding transfer
    51 								4. Acknowledge transfer cancelled
    52 	@SYMTestExpectedResults 	Outstanding NAK control transfer is cancelled
    53 	@SYMTestStatus				Implemented
    54 	
    55 
    56 */
    57 class CUT_PBASE_T_USBDI_0489 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
    58 	{
    59 public:
    60 	static CUT_PBASE_T_USBDI_0489* NewL(TBool aHostRole);
    61 	~CUT_PBASE_T_USBDI_0489(); 
    62 
    63 public: // From MBusObserver
    64 	void DeviceInsertedL(TUint aDeviceHandle);
    65 	void DeviceRemovedL(TUint aDeviceHandle);
    66 	void BusErrorL(TInt aError);
    67 	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
    68 			TInt aCompletionCode);
    69 
    70 public: // From MCommandObserver
    71 	void Ep0TransferCompleteL(TInt aCompletionCode);
    72 
    73 private:
    74 	CUT_PBASE_T_USBDI_0489(TBool aHostRole);
    75 	void ConstructL();
    76 	void ExecuteHostTestCaseL();
    77 	void ExecuteDeviceTestCaseL();
    78 	void HostDoCancel();
    79 	void DeviceDoCancel();
    80 	void HostRunL();
    81 	void DeviceRunL();
    82 
    83 private:
    84 
    85 	enum TCaseStep
    86 		{
    87 		EInProgress,
    88 		EFailed,
    89 		EPassed
    90 		};
    91 
    92 	CActorFDF* iActorFDF;
    93 	
    94 	CEp0Transfer* iControlEp0;
    95 	RUsbInterface iUsbInterface0;
    96 	TUint32 iToken0;
    97 
    98 	TCaseStep iCaseStep;
    99 	
   100 	RUsbDeviceVendor* iTestDevice;
   101 	
   102 private:
   103 	/**
   104 	The functor to create this test case from the factory
   105 	*/
   106 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0489,TBool> iFunctor;
   107 	};
   108 
   109 	}
   110 
   111 
   112 #endif