os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/PBASE-T_USBDI-0477.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
#ifndef __TEST_CASE_PBASE_T_USBDI_0477_H
sl@0
     2
#define __TEST_CASE_PBASE_T_USBDI_0477_H
sl@0
     3
sl@0
     4
/*
sl@0
     5
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     6
* All rights reserved.
sl@0
     7
* This component and the accompanying materials are made available
sl@0
     8
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     9
* which accompanies this distribution, and is available
sl@0
    10
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
    11
*
sl@0
    12
* Initial Contributors:
sl@0
    13
* Nokia Corporation - initial contribution.
sl@0
    14
*
sl@0
    15
* Contributors:
sl@0
    16
*
sl@0
    17
* Description:
sl@0
    18
* @file PBASE-T_USBDI-0477.h
sl@0
    19
* @internalComponent
sl@0
    20
* 
sl@0
    21
*
sl@0
    22
*/
sl@0
    23
sl@0
    24
sl@0
    25
sl@0
    26
 
sl@0
    27
#include "BaseTestCase.h" 
sl@0
    28
#include "TestCaseFactory.h"
sl@0
    29
#include "modelleddevices.h"
sl@0
    30
#include <d32usbdi.h>
sl@0
    31
#include <d32usbdi_hubdriver.h>
sl@0
    32
#include "FDFActor.h"
sl@0
    33
#include <d32usbc.h>
sl@0
    34
#include "testdebug.h"
sl@0
    35
#include "controltransferrequests.h"
sl@0
    36
 
sl@0
    37
namespace NUnitTesting_USBDI
sl@0
    38
	{
sl@0
    39
sl@0
    40
/**
sl@0
    41
sl@0
    42
	
sl@0
    43
	@SYMTestCaseID				PBASE-T_USBDI-0477
sl@0
    44
	@SYMTestCaseDesc			Selection of two alternate interface settings where the second selection
sl@0
    45
								fails and the interface rolls back
sl@0
    46
	@SYMFssID 
sl@0
    47
	@SYMPREQ					1782
sl@0
    48
	@SYMREQ						7046 [USBD : Changing alternate interface setting]
sl@0
    49
								7047 [USBD : Roll-back of alternate interface setting]
sl@0
    50
								7048 [USBD : Default Alternate Interface setting]
sl@0
    51
								7049 [USBD : Establishment of pipes]
sl@0
    52
								7050 [USBD : Closing of pipes]
sl@0
    53
	@SYMTestType				UT
sl@0
    54
	@SYMTestPriority			1 
sl@0
    55
	@SYMTestActions 			1. Open interfaces on connected device
sl@0
    56
								2. Open and close a bulk pipe on default setting 0
sl@0
    57
								3. Select alternate interface setting 1 and establish a pipe then close it
sl@0
    58
								4. If alternate interface selection fails, establish that the pipe previously 
sl@0
    59
								   opened in step 2 can be opened again.
sl@0
    60
	@SYMTestExpectedResults 	Pipes can be established in either interface setting
sl@0
    61
	@SYMTestStatus				Implemented
sl@0
    62
	
sl@0
    63
sl@0
    64
*/	
sl@0
    65
class CUT_PBASE_T_USBDI_0477 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
sl@0
    66
	{
sl@0
    67
public:
sl@0
    68
	static CUT_PBASE_T_USBDI_0477* NewL(TBool aHostRole);
sl@0
    69
	~CUT_PBASE_T_USBDI_0477(); 
sl@0
    70
sl@0
    71
public: // From MUsbBusObserver
sl@0
    72
	void DeviceInsertedL(TUint aDeviceHandle);
sl@0
    73
	void DeviceRemovedL(TUint aDeviceHandle);
sl@0
    74
	void BusErrorL(TInt aError);
sl@0
    75
	void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
sl@0
    76
		TInt aCompletionCode);
sl@0
    77
sl@0
    78
public: // From MCommandObserver
sl@0
    79
	void Ep0TransferCompleteL(TInt aCompletionCode);
sl@0
    80
	
sl@0
    81
private:
sl@0
    82
	CUT_PBASE_T_USBDI_0477(TBool aHostRole);
sl@0
    83
	void ConstructL();
sl@0
    84
	void ExecuteHostTestCaseL();
sl@0
    85
	void ExecuteDeviceTestCaseL();
sl@0
    86
	void HostDoCancel();
sl@0
    87
	void DeviceDoCancel();
sl@0
    88
	void HostRunL();
sl@0
    89
	void DeviceRunL();
sl@0
    90
	TBool CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor);
sl@0
    91
sl@0
    92
private:
sl@0
    93
	enum TCaseStep 
sl@0
    94
		{
sl@0
    95
		EInProgress,
sl@0
    96
		EFailed,
sl@0
    97
		EPassed
sl@0
    98
		};
sl@0
    99
		
sl@0
   100
	CActorFDF* iActorFDF;
sl@0
   101
	CEp0Transfer* iClientAction;
sl@0
   102
	RUsbInterface iUsbInterface0;
sl@0
   103
	RUsbInterface iUsbInterface1;
sl@0
   104
	RUsbPipe iTestPipe;
sl@0
   105
	TCaseStep iCaseStep;
sl@0
   106
	
sl@0
   107
	RUsbDeviceA* iTestDevice;
sl@0
   108
sl@0
   109
private:
sl@0
   110
	/**
sl@0
   111
	The functor for this test case for the factory
sl@0
   112
	*/
sl@0
   113
	const static TFunctorTestCase<CUT_PBASE_T_USBDI_0477,TBool> iFunctor;
sl@0
   114
	};
sl@0
   115
sl@0
   116
	
sl@0
   117
	}
sl@0
   118
sl@0
   119
#endif