sl@0: #ifndef __TEST_CASE_PBASE_T_USBDI_1234_H sl@0: #define __TEST_CASE_PBASE_T_USBDI_1234_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-1234.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include "BaseBulkTestCase.h" sl@0: #include "basicwatcher.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: /** sl@0: sl@0: @SYMTestCaseID PBASE-T_USBDI-1234 sl@0: @SYMTestCaseDesc Device suspend and resume only depend on the RUsbInterface sl@0: @SYMFssID Def126984 sl@0: @SYMPREQ BR2609 sl@0: @SYMTestType UT sl@0: @SYMTestPriority 1 sl@0: @SYMTestActions 1. after device suspended,call resume interface and immediately do some bulk transfer operation sl@0: @SYMTestExpectedResults Correct suspension and device resumption can be established sl@0: @SYMTestStatus Implemented sl@0: sl@0: */ sl@0: class CUT_PBASE_T_USBDI_1234 : public CBaseBulkTestCase, sl@0: public MTransferObserver, public MCommandObserver sl@0: sl@0: { sl@0: public: sl@0: static CUT_PBASE_T_USBDI_1234* NewL(TBool aHostRole); sl@0: ~CUT_PBASE_T_USBDI_1234(); sl@0: sl@0: static TInt Interface0ResumedL(TAny* aPtr); sl@0: static TInt Interface1ResumedL(TAny* aPtr); sl@0: static TInt Interface2ResumedL(TAny* aPtr); sl@0: sl@0: private: sl@0: enum TCaseSteps sl@0: { sl@0: EInProgress, sl@0: ESuspendDevice, sl@0: EValidateResumebyInterface, sl@0: EBulkTransferOutWhenResume, sl@0: EValidBulkTransfeOut, // tranfer in read sl@0: EFailed, sl@0: EPassed sl@0: }; sl@0: sl@0: enum TDeviceInsertedError sl@0: { sl@0: ENone, sl@0: EError, sl@0: EFatalError, sl@0: }; sl@0: sl@0: public: sl@0: // From MUsbBusObserver sl@0: void DeviceInsertedL(TUint aDeviceHandle); sl@0: void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState, sl@0: RUsbDevice::TDeviceState aNewState, TInt aCompletionCode); sl@0: sl@0: public: sl@0: // From MCommandObserver sl@0: void Ep0TransferCompleteL(TInt aCompletionCode); sl@0: sl@0: public: sl@0: // From MTransferObserver sl@0: void TransferCompleteL(TInt aTransferId, TInt aCompletionCode); sl@0: sl@0: sl@0: private: sl@0: CUT_PBASE_T_USBDI_1234(TBool aHostRole); sl@0: void ConstructL(); sl@0: void ExecuteHostTestCaseL(); sl@0: sl@0: private: sl@0: sl@0: sl@0: sl@0: private: sl@0: sl@0: void TrySuspendDeviceByInterfaces(); sl@0: sl@0: void SendEpRequest(); sl@0: void SendEpTransferRequest(); sl@0: sl@0: TInt DoBulkOutTransfer(TInt aTransferId, TInt aCompletionCode, sl@0: TDes & aMsg); sl@0: void TryResumeTransferImmediately(RUsbDevice::TDeviceState aState); sl@0: sl@0: sl@0: private: sl@0: sl@0: CInterfaceWatcher* iInterface0Watcher; sl@0: CInterfaceWatcher* iInterface1Watcher; sl@0: CInterfaceWatcher* iInterface2Watcher; sl@0: sl@0: TBool iSuspendedI0; sl@0: TBool iSuspendedI1; sl@0: TBool iSuspendedI2; sl@0: sl@0: TCaseSteps iCaseStep; sl@0: 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: #endif