First public contribution.
1 #ifndef __TEST_CASE_PBASE_T_USBDI_0486_H
2 #define __TEST_CASE_PBASE_T_USBDI_0486_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-0486.h
27 #include "BaseBulkTestCase.h"
28 #include "TestCaseFactory.h"
30 #include "modelleddevices.h"
31 #include "controltransferrequests.h"
33 #include "testdebug.h"
34 #include "hosttransfers.h"
36 _LIT(KTestDeviceC_SN, "TestDeviceC - CUT_PBASE_T_USBDI_0486");
38 namespace NUnitTesting_USBDI
44 @SYMTestCaseID PBASE-T_USBDI-0486
45 @SYMTestCaseDesc Validation of opening interfaces after a device change
48 @SYMREQ 7067 - [ USBD : Interface access: Changed device]
49 7068 - [ USBD : Interface access: Consistency across device addition/removal]
50 7069 - [ USBD : Interface access: Re-open an interface]
51 7126 - [ USBD : Cancellation of transfer]
54 @SYMTestActions 1. Enumerate A
55 2. Get token for interface 0 (token 0) – save token 0
56 3. Open interface 0 with token 0
57 4. Get token for interface 1 (token 1)
58 5. Open interface 1 (token 1)
59 6. Open pipe on interface 1, endpoint 2
60 7. Queue bulk in transfer on pipe
61 8. Vendor dependant request : Disconnect A- Connect C sent to device A
62 9. Transfer completes with cancelled error code
65 12. Try to open interface 0 with previous token 0, fails since token is invalid
66 13. Get token for interface 0 (token 2)
67 14. Open interface 0 (token 2)
68 15. Vendor dependant request : Disconnect C- Connect A sent to device C
71 18. Get token for interface 0 (token 3)
72 19. Open interface 0 with token 3
73 @SYMTestExpectedResults Unable to open any interface using expired token, Transfer cancelled on disconnection
74 @SYMTestStatus Implemented
78 class CUT_PBASE_T_USBDI_0486 : public CBaseBulkTestCase,
79 public MTransferObserver,
80 public MCommandObserver
83 static CUT_PBASE_T_USBDI_0486* NewL(TBool aHostRole);
84 ~CUT_PBASE_T_USBDI_0486();
86 public: // From MBusObserver
87 void DeviceInsertedL(TUint aDeviceHandle);
88 void DeviceRemovedL(TUint aDeviceHandle);
90 public: // From MTransferObserver
91 void TransferCompleteL(TInt aTransferId,TInt aCompletionCode);
93 public: // From MCommandObserver
94 void Ep0TransferCompleteL(TInt aCompletionCode);
97 CUT_PBASE_T_USBDI_0486(TBool aHostRole);
99 void ExecuteDeviceTestCaseL();
101 void DeviceDoCancel();
102 TBool CheckSN(const TDesC16& aSerialNumberGot, const TDesC& aExpectedSerialNumber);
110 EWaitForDeviceCConnection,
113 EWaitForDeviceCDisconnection,
114 EWaitForDeviceAConnection
118 TUint32 iToken0DeviceC;
119 RUsbDeviceC* iTestDeviceC;
123 RUsbDeviceC* TestDeviceC();
124 RUsbDeviceD* TestDeviceD();
125 void HandleDeviceDConnection();
129 The functor to create this test case from the factory
131 const static TFunctorTestCase<CUT_PBASE_T_USBDI_0486,TBool> iFunctor;