os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0474.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_0474_H
     2 #define __TEST_CASE_PBASE_T_USBDI_0474_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-0474.h
    19 * @internalComponent
    20 * 
    21 *
    22 */
    23 
    24 
    25 
    26  
    27 #include "BaseTestCase.h"
    28 #include "TestCaseFactory.h"
    29 #include "modelleddevices.h"
    30 #include <d32usbdi.h>
    31 #include <d32usbdi_hubdriver.h>
    32 #include "FDFActor.h"
    33 #include <d32usbc.h>
    34 #include "testdebug.h"
    35 #include "controltransferrequests.h"
    36  
    37 namespace NUnitTesting_USBDI
    38 	{
    39 
    40 /**
    41 
    42 	
    43 	@SYMTestCaseID				PBASE-T_USBDI-0474
    44 	@SYMTestCaseDesc			Acceptance of unknown descriptor from USB device.
    45 	@SYMFssID 
    46 	@SYMPREQ					1782
    47 	@SYMREQ						7059 - [USBD : Descriptor access: unknown descriptors]
    48                                 7060 - [USBD : Descriptor access: backward compatibility]
    49                                 
    50 	@SYMTestType				UT
    51 	@SYMTestPriority			1 
    52 	@SYMTestActions 			1. Enumerate
    53 								2. Read Descriptor
    54 								3. Compare against reference descriptor tree
    55 	@SYMTestExpectedResults 	Descriptor read and processed into tree correctly.
    56 	@SYMTestStatus				Implemented
    57 	
    58 
    59 */	
    60 class CUT_PBASE_T_USBDI_0474 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
    61 	{
    62 public:
    63 	static CUT_PBASE_T_USBDI_0474* NewL(TBool aHostRole);
    64 	~CUT_PBASE_T_USBDI_0474(); 
    65 
    66 public: // From MUsbBusObserver
    67 	void DeviceInsertedL(TUint aDeviceHandle);
    68 	void DeviceRemovedL(TUint aDeviceHandle);
    69 	void BusErrorL(TInt aError);
    70 	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
    71 		TInt aCompletionCode);
    72 
    73 public: // From MCommandObserver
    74 	void Ep0TransferCompleteL(TInt aCompletionCode);
    75 	
    76 private:
    77 	CUT_PBASE_T_USBDI_0474(TBool aHostRole);
    78 	void ConstructL();
    79 	void ExecuteHostTestCaseL();
    80 	void ExecuteDeviceTestCaseL();
    81 	void HostDoCancel();
    82 	void DeviceDoCancel();
    83 	void HostRunL();
    84 	void DeviceRunL();
    85 
    86 private:
    87 	enum TCaseStep 
    88 		{
    89 		EInProgress,
    90 		EFailed,
    91 		EPassed
    92 		}; 
    93 		
    94 	CActorFDF* iActorFDF;
    95 	CEp0Transfer* iClientAction;
    96 	RUsbInterface iUsbInterface0;
    97 	RUsbInterface iUsbInterface1;
    98 	RUsbPipe iTestPipe;
    99 	TCaseStep iCaseStep;
   100 	
   101 	RUsbDeviceB* iTestDevice;
   102 
   103 private:
   104 	/**
   105 	The functor for this test case for the factory
   106 	*/
   107 	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0474,TBool> iFunctor;
   108 	};
   109 
   110 	
   111 	}
   112 
   113 #endif