First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_1235_H
2 #define __TEST_CASE_PBASE_T_USBDI_1235_H
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
18 * @file PBASE-T_USBDI-1235.h
27 #include "BaseTestCase.h"
28 #include "TestCaseFactory.h"
30 #include <d32usbdi_hubdriver.h>
32 #include "modelleddevices.h"
33 #include "controltransferrequests.h"
34 #include "basicwatcher.h"
35 #include "basebulktestcase.h" // use the bulktransfertimer.
36 #include "hosttransfers.h"
38 namespace NUnitTesting_USBDI
43 @SYMTestCaseID PBASE-T_USBDI-1235
44 @SYMTestCaseDesc Cancel immediately after requesting device suspension , do not care the devic's tate is suspend or resume.
50 @SYMTestActions suspend device and immediately cancel suspend request.
51 @SYMTestExpectedResults Correct suspension and device resumption can be established
52 @SYMTestStatus Implemented
58 class CUT_PBASE_T_USBDI_1235 : public CBaseTestCase,
59 public MUsbBusObserver, public MCommandObserver
63 static CUT_PBASE_T_USBDI_1235* NewL(TBool aHostRole);
64 ~CUT_PBASE_T_USBDI_1235();
66 static TInt Interface0ResumedL(TAny* aPtr);
67 static TInt Interface1ResumedL(TAny* aPtr);
73 ECancelSuspendWhenInterfaceSuspension,
74 EValidCancelSuspendAfterInterfaceSuspend,
79 enum TDeviceInsertedError
87 // From MUsbBusObserver
88 void DeviceInsertedL(TUint aDeviceHandle);
89 void DeviceRemovedL(TUint aDeviceHandle);
90 void BusErrorL(TInt aError);
91 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
92 RUsbDevice::TDeviceState aNewState, TInt aCompletionCode);
95 // From MCommandObserver
96 void Ep0TransferCompleteL(TInt aCompletionCode);
104 CUT_PBASE_T_USBDI_1235(TBool aHostRole);
106 void ExecuteHostTestCaseL();
107 void ExecuteDeviceTestCaseL();
109 void DeviceDoCancel();
116 void SuspendDeviceByInterfacesAndCancelWaitForResume();
117 void SendEp0Request(); // for b device stop
122 CActorFDF* iActorFDF;
123 CEp0Transfer* iControlEp0;
124 RUsbInterface iUsbInterface0;
125 RUsbInterface iUsbInterface1;
126 CInterfaceWatcher* iInterface0Watcher;
127 CInterfaceWatcher* iInterface1Watcher;
132 RUsbDeviceA* iTestDevice;
133 TCaseSteps iCaseStep;
138 The functor for this test case for the factory
140 const static TFunctorTestCase<CUT_PBASE_T_USBDI_1235,TBool> iFunctor;