First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0481_H
2 #define __TEST_CASE_PBASE_T_USBDI_0481_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-0481.h
27 #include "BaseTestCase.h"
28 #include "TestCaseFactory.h"
30 #include "modelleddevices.h"
31 #include "controltransferrequests.h"
33 #include "testdebug.h"
35 namespace NUnitTesting_USBDI
41 @SYMTestCaseID PBASE-T_USBDI-0481
42 @SYMTestCaseDesc Validation of error codes when re-opening interfaces.
45 @SYMREQ 7066 - [ USBD : Interface access: Two attempted concurrent opens]
46 7126 - [ USBD : Cancellation of transfer]
49 @SYMTestActions 1. Enumerate A
50 2. Get the token for interface 0
52 4. Get the token for interface 1
54 6. Get the token for interface 1 again, validate error code
55 7. Open interface 1 again, validate error code
57 @SYMTestExpectedResults Error codes validated
58 @SYMTestStatus Implemented
62 class CUT_PBASE_T_USBDI_0481 : public CBaseTestCase, public MUsbBusObserver, public MCommandObserver
65 static CUT_PBASE_T_USBDI_0481* NewL(TBool aHostRole);
66 ~CUT_PBASE_T_USBDI_0481();
68 public: // From MBusObserver
69 void DeviceInsertedL(TUint aDeviceHandle);
70 void DeviceRemovedL(TUint aDeviceHandle);
71 void BusErrorL(TInt aError);
72 void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,RUsbDevice::TDeviceState aNewState,
73 TInt aCompletionCode);
75 public: // From MCommandObserver
76 void Ep0TransferCompleteL(TInt aCompletionCode);
79 CUT_PBASE_T_USBDI_0481(TBool aHostRole);
81 void ExecuteHostTestCaseL();
82 void ExecuteDeviceTestCaseL();
84 void DeviceDoCancel();
99 CEp0Transfer* iControlEp0;
100 RUsbInterface iUsbInterface0;
101 RUsbInterface iUsbInterface1;
106 RUsbDeviceA* iTestDevice;
110 The functor to create this test case from the factory
112 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0481,TBool> iFunctor;