os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-1236.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 #ifndef __TEST_CASE_PBASE_T_USBDI_1236_H
     2 #define __TEST_CASE_PBASE_T_USBDI_1236_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-1236.h
    19 * @internalComponent
    20 *
    21 */
    22 
    23 
    24 
    25 
    26 #include "BaseTestCase.h"
    27 #include "TestCaseFactory.h"
    28 #include <d32usbdi.h>
    29 #include <d32usbdi_hubdriver.h>
    30 #include "FDFActor.h"
    31 #include "modelleddevices.h"
    32 #include "controltransferrequests.h"
    33 
    34 namespace NUnitTesting_USBDI
    35 	{
    36 
    37 /**
    38 
    39 	
    40 	@SYMTestCaseID				PBASE-T_USBDI-1236
    41 	@SYMTestCaseDesc			Get Interface description string
    42 	@SYMFssID 
    43 	@SYMPREQ					1782
    44 	@SYMREQ						7074 [USBD : Device suspension]
    45 								7075 [USBD : Device suspension: multiple interfaces]
    46 								7076 [USBD : Device resume]
    47 								7077 [USBD : Remote wakeup]
    48 								7078 [USBD : Suspend following a wake up]
    49 	@SYMTestType				UT
    50 	@SYMTestPriority			1 
    51 	@SYMTestActions 			1. Suspend a connected device through its interfaces
    52 								2. Resume a interface
    53 								3. Once device is resumed, enable remote wake-up and suspend all interfaces again 
    54 								4. Remote wake up device
    55 								5. Following a remote wake-up, suspend device again
    56 	@SYMTestExpectedResults 	Correct suspension and device resumption can be established
    57 	@SYMTestStatus				Implemented
    58 	
    59 
    60 */	
    61 class CUT_PBASE_T_USBDI_1236 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
    62 	{
    63 public:
    64 	static CUT_PBASE_T_USBDI_1236* NewL(TBool aHostRole);
    65 	~CUT_PBASE_T_USBDI_1236(); 
    66 
    67 private: 
    68 	enum TCaseSteps
    69 		{
    70 		EStepGetInterfaceString,
    71 		EPassed,
    72 		EFailed
    73 		};
    74 
    75 public: // From MUsbBusObserver
    76 	void DeviceInsertedL(TUint aDeviceHandle);
    77 	void DeviceRemovedL(TUint aDeviceHandle);
    78 	void BusErrorL(TInt aError);
    79 	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
    80 		TInt aCompletionCode);
    81 	
    82 public: // From MCommandObserver
    83 	void Ep0TransferCompleteL(TInt aCompletionCode);
    84 
    85 private:
    86 	CUT_PBASE_T_USBDI_1236(TBool aHostRole);
    87 	void ConstructL();
    88 	void ExecuteHostTestCaseL();
    89 	void ExecuteDeviceTestCaseL();
    90 	void HostDoCancel();
    91 	void DeviceDoCancel();
    92 	void HostRunL();
    93 	void DeviceRunL();
    94 
    95 private:
    96 
    97 	CActorFDF* iActorFDF;
    98 	CEp0Transfer* iControlEp0;
    99 	RUsbInterface iUsbInterface0;
   100 	RUsbInterface iUsbInterface1;
   101 	TUint iDeviceHandle;
   102 
   103 	TCaseSteps iCaseStep;
   104 	
   105 	RUsbDeviceA* iTestDevice;
   106 	
   107 private:
   108 	/**
   109 	The functor for this test case for the factory
   110 	*/
   111 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_1236,TBool> iFunctor;
   112 	};
   113 
   114 	}
   115 	
   116 #endif