First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_1231_H
2 #define __TEST_CASE_PBASE_T_USBDI_1231_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-1231.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 bulktranfertimer.
36 #include "hosttransfers.h"
38 namespace NUnitTesting_USBDI
43 @SYMTestCaseID PBASE-T_USBDI-1231
44 @SYMTestCaseDesc Device suspension immediately resume
50 @SYMTestActions 1. suspend device and immediately resume.
51 @SYMTestExpectedResults Correct suspension and device resumption can be established
52 @SYMTestStatus Implemented
58 class CUT_PBASE_T_USBDI_1231 : public CBaseTestCase,
59 public MUsbBusObserver, public MCommandObserver
63 static CUT_PBASE_T_USBDI_1231* NewL(TBool aHostRole);
64 ~CUT_PBASE_T_USBDI_1231();
66 static TInt Interface0ResumedL(TAny* aPtr);
67 static TInt Interface1ResumedL(TAny* aPtr);
73 EResumeWhenSuspending,
76 EValidResumeWhenSuspending,
81 enum TDeviceInsertedError
89 // From MUsbBusObserver
90 void DeviceInsertedL(TUint aDeviceHandle);
91 void DeviceRemovedL(TUint aDeviceHandle);
92 void BusErrorL(TInt aError);
93 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
94 RUsbDevice::TDeviceState aNewState, TInt aCompletionCode);
97 // From MCommandObserver
98 void Ep0TransferCompleteL(TInt aCompletionCode);
103 CUT_PBASE_T_USBDI_1231(TBool aHostRole);
105 void ExecuteHostTestCaseL();
106 void ExecuteDeviceTestCaseL();
108 void DeviceDoCancel();
115 void ResumeWhenSuspending();
116 void SendEp0Request(); // send control request
121 CActorFDF* iActorFDF;
122 CEp0Transfer* iControlEp0;
123 RUsbInterface iUsbInterface0;
124 RUsbInterface iUsbInterface1;
125 CInterfaceWatcher* iInterface0Watcher;
126 CInterfaceWatcher* iInterface1Watcher;
129 RUsbDeviceA* iTestDevice;
130 TCaseSteps iCaseStep;
132 TThreadPriority iPriority;
136 The functor for this test case for the factory
138 const static TFunctorTestCase<CUT_PBASE_T_USBDI_1231,TBool> iFunctor;