Update contrib.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0473_H
2 #define __TEST_CASE_PBASE_T_USBDI_0473_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-0473.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"
36 namespace NUnitTesting_USBDI
42 @SYMTestCaseID PBASE-T_USBDI-0473
43 @SYMTestCaseDesc Device suspension, Resumption and remote wakeup (multiple interfaces)
46 @SYMREQ 7074 [USBD : Device suspension]
47 7075 [USBD : Device suspension: multiple interfaces]
48 7076 [USBD : Device resume]
49 7077 [USBD : Remote wakeup]
50 7078 [USBD : Suspend following a wake up]
53 @SYMTestActions 1. Suspend a connected device through its interfaces
55 3. Once device is resumed, enable remote wake-up and suspend all interfaces again
56 4. Remote wake up device
57 5. Following a remote wake-up, suspend device again
58 @SYMTestExpectedResults Correct suspension and device resumption can be established
59 @SYMTestStatus Implemented
63 class CUT_PBASE_T_USBDI_0473 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
66 static CUT_PBASE_T_USBDI_0473* NewL(TBool aHostRole);
67 ~CUT_PBASE_T_USBDI_0473();
69 static TInt Interface0ResumedL(TAny* aPtr);
70 static TInt Interface1ResumedL(TAny* aPtr);
71 TInt CheckForAllResumedNotificationsAndContinueFSM();
72 TInt ContinueFSMAfterAllResumedNotifications();
78 EValidateSuspendingInterfaces,
79 EValidateResumptionAfterInterfaceSuspension,
80 ESuspendForRemoteWakeup,
81 EValidateSuspendForRemoteWakeup,
82 EValidateResumptionAfterWakeup,
83 EValidateSuspendAfterWakeup,
88 public: // From MUsbBusObserver
89 void DeviceInsertedL(TUint aDeviceHandle);
90 void DeviceRemovedL(TUint aDeviceHandle);
91 void BusErrorL(TInt aError);
92 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
93 TInt aCompletionCode);
95 public: // From MCommandObserver
96 void Ep0TransferCompleteL(TInt aCompletionCode);
99 CUT_PBASE_T_USBDI_0473(TBool aHostRole);
101 void ExecuteHostTestCaseL();
102 void ExecuteDeviceTestCaseL();
104 void DeviceDoCancel();
110 CActorFDF* iActorFDF;
111 CEp0Transfer* iControlEp0;
112 RUsbInterface iUsbInterface0;
113 RUsbInterface iUsbInterface1;
114 CInterfaceWatcher* iInterface0Watcher;
115 CInterfaceWatcher* iInterface1Watcher;
120 TCaseSteps iCaseStep;
122 RUsbDeviceA* iTestDevice;
123 RUsbDevice::TDeviceState iStoredNewState;
124 TBool iDeviceNotificationPending;
127 The functor for this test case for the factory
129 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0473,TBool> iFunctor;