sl@0: #ifndef __TEST_CASE_PBASE_T_USBDI_0477_H sl@0: #define __TEST_CASE_PBASE_T_USBDI_0477_H sl@0: sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * @file PBASE-T_USBDI-0477.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #include "BaseTestCase.h" sl@0: #include "TestCaseFactory.h" sl@0: #include "modelleddevices.h" sl@0: #include sl@0: #include sl@0: #include "FDFActor.h" sl@0: #include sl@0: #include "testdebug.h" sl@0: #include "controltransferrequests.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: /** sl@0: sl@0: sl@0: @SYMTestCaseID PBASE-T_USBDI-0477 sl@0: @SYMTestCaseDesc Selection of two alternate interface settings where the second selection sl@0: fails and the interface rolls back sl@0: @SYMFssID sl@0: @SYMPREQ 1782 sl@0: @SYMREQ 7046 [USBD : Changing alternate interface setting] sl@0: 7047 [USBD : Roll-back of alternate interface setting] sl@0: 7048 [USBD : Default Alternate Interface setting] sl@0: 7049 [USBD : Establishment of pipes] sl@0: 7050 [USBD : Closing of pipes] sl@0: @SYMTestType UT sl@0: @SYMTestPriority 1 sl@0: @SYMTestActions 1. Open interfaces on connected device sl@0: 2. Open and close a bulk pipe on default setting 0 sl@0: 3. Select alternate interface setting 1 and establish a pipe then close it sl@0: 4. If alternate interface selection fails, establish that the pipe previously sl@0: opened in step 2 can be opened again. sl@0: @SYMTestExpectedResults Pipes can be established in either interface setting sl@0: @SYMTestStatus Implemented sl@0: sl@0: sl@0: */ sl@0: class CUT_PBASE_T_USBDI_0477 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver sl@0: { sl@0: public: sl@0: static CUT_PBASE_T_USBDI_0477* NewL(TBool aHostRole); sl@0: ~CUT_PBASE_T_USBDI_0477(); sl@0: sl@0: public: // From MUsbBusObserver sl@0: void DeviceInsertedL(TUint aDeviceHandle); sl@0: void DeviceRemovedL(TUint aDeviceHandle); sl@0: void BusErrorL(TInt aError); sl@0: void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState, sl@0: TInt aCompletionCode); sl@0: sl@0: public: // From MCommandObserver sl@0: void Ep0TransferCompleteL(TInt aCompletionCode); sl@0: sl@0: private: sl@0: CUT_PBASE_T_USBDI_0477(TBool aHostRole); sl@0: void ConstructL(); sl@0: void ExecuteHostTestCaseL(); sl@0: void ExecuteDeviceTestCaseL(); sl@0: void HostDoCancel(); sl@0: void DeviceDoCancel(); sl@0: void HostRunL(); sl@0: void DeviceRunL(); sl@0: TBool CheckFirstInterfaceDescriptorDeviceA(TUsbInterfaceDescriptor& aIfDescriptor); sl@0: sl@0: private: sl@0: enum TCaseStep sl@0: { sl@0: EInProgress, sl@0: EFailed, sl@0: EPassed sl@0: }; sl@0: sl@0: CActorFDF* iActorFDF; sl@0: CEp0Transfer* iClientAction; sl@0: RUsbInterface iUsbInterface0; sl@0: RUsbInterface iUsbInterface1; sl@0: RUsbPipe iTestPipe; sl@0: TCaseStep iCaseStep; sl@0: sl@0: RUsbDeviceA* iTestDevice; sl@0: sl@0: private: sl@0: /** sl@0: The functor for this test case for the factory sl@0: */ sl@0: const static TFunctorTestCase iFunctor; sl@0: }; sl@0: sl@0: sl@0: } sl@0: sl@0: #endif