sl@0
|
1 |
#ifndef __TEST_CASE_PBASE_T_USBDI_1235_H
|
sl@0
|
2 |
#define __TEST_CASE_PBASE_T_USBDI_1235_H
|
sl@0
|
3 |
|
sl@0
|
4 |
/*
|
sl@0
|
5 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
6 |
* All rights reserved.
|
sl@0
|
7 |
* This component and the accompanying materials are made available
|
sl@0
|
8 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
9 |
* which accompanies this distribution, and is available
|
sl@0
|
10 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Initial Contributors:
|
sl@0
|
13 |
* Nokia Corporation - initial contribution.
|
sl@0
|
14 |
*
|
sl@0
|
15 |
* Contributors:
|
sl@0
|
16 |
*
|
sl@0
|
17 |
* Description:
|
sl@0
|
18 |
* @file PBASE-T_USBDI-1235.h
|
sl@0
|
19 |
* @internalComponent
|
sl@0
|
20 |
*
|
sl@0
|
21 |
*
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
|
sl@0
|
27 |
#include "BaseTestCase.h"
|
sl@0
|
28 |
#include "TestCaseFactory.h"
|
sl@0
|
29 |
#include <d32usbdi.h>
|
sl@0
|
30 |
#include <d32usbdi_hubdriver.h>
|
sl@0
|
31 |
#include "FDFActor.h"
|
sl@0
|
32 |
#include "modelleddevices.h"
|
sl@0
|
33 |
#include "controltransferrequests.h"
|
sl@0
|
34 |
#include "basicwatcher.h"
|
sl@0
|
35 |
#include "basebulktestcase.h" // use the bulktransfertimer.
|
sl@0
|
36 |
#include "hosttransfers.h"
|
sl@0
|
37 |
|
sl@0
|
38 |
namespace NUnitTesting_USBDI
|
sl@0
|
39 |
{
|
sl@0
|
40 |
|
sl@0
|
41 |
/**
|
sl@0
|
42 |
|
sl@0
|
43 |
@SYMTestCaseID PBASE-T_USBDI-1235
|
sl@0
|
44 |
@SYMTestCaseDesc Cancel immediately after requesting device suspension , do not care the devic's tate is suspend or resume.
|
sl@0
|
45 |
@SYMFssID DEF126984
|
sl@0
|
46 |
@SYMPREQ BR2609
|
sl@0
|
47 |
|
sl@0
|
48 |
@SYMTestType UT
|
sl@0
|
49 |
@SYMTestPriority 1
|
sl@0
|
50 |
@SYMTestActions suspend device and immediately cancel suspend request.
|
sl@0
|
51 |
@SYMTestExpectedResults Correct suspension and device resumption can be established
|
sl@0
|
52 |
@SYMTestStatus Implemented
|
sl@0
|
53 |
|
sl@0
|
54 |
*/
|
sl@0
|
55 |
|
sl@0
|
56 |
class CBulkTransfer;
|
sl@0
|
57 |
|
sl@0
|
58 |
class CUT_PBASE_T_USBDI_1235 : public CBaseTestCase,
|
sl@0
|
59 |
public MUsbBusObserver, public MCommandObserver
|
sl@0
|
60 |
|
sl@0
|
61 |
{
|
sl@0
|
62 |
public:
|
sl@0
|
63 |
static CUT_PBASE_T_USBDI_1235* NewL(TBool aHostRole);
|
sl@0
|
64 |
~CUT_PBASE_T_USBDI_1235();
|
sl@0
|
65 |
|
sl@0
|
66 |
static TInt Interface0ResumedL(TAny* aPtr);
|
sl@0
|
67 |
static TInt Interface1ResumedL(TAny* aPtr);
|
sl@0
|
68 |
|
sl@0
|
69 |
private:
|
sl@0
|
70 |
enum TCaseSteps
|
sl@0
|
71 |
{
|
sl@0
|
72 |
EInProcess,
|
sl@0
|
73 |
ECancelSuspendWhenInterfaceSuspension,
|
sl@0
|
74 |
EValidCancelSuspendAfterInterfaceSuspend,
|
sl@0
|
75 |
EFailed,
|
sl@0
|
76 |
EPassed
|
sl@0
|
77 |
};
|
sl@0
|
78 |
|
sl@0
|
79 |
enum TDeviceInsertedError
|
sl@0
|
80 |
{
|
sl@0
|
81 |
ENone,
|
sl@0
|
82 |
EError,
|
sl@0
|
83 |
EFatalError,
|
sl@0
|
84 |
};
|
sl@0
|
85 |
|
sl@0
|
86 |
public:
|
sl@0
|
87 |
// From MUsbBusObserver
|
sl@0
|
88 |
void DeviceInsertedL(TUint aDeviceHandle);
|
sl@0
|
89 |
void DeviceRemovedL(TUint aDeviceHandle);
|
sl@0
|
90 |
void BusErrorL(TInt aError);
|
sl@0
|
91 |
void DeviceStateChangeL(RUsbDevice::TDeviceState aPreviousState,
|
sl@0
|
92 |
RUsbDevice::TDeviceState aNewState, TInt aCompletionCode);
|
sl@0
|
93 |
|
sl@0
|
94 |
public:
|
sl@0
|
95 |
// From MCommandObserver
|
sl@0
|
96 |
void Ep0TransferCompleteL(TInt aCompletionCode);
|
sl@0
|
97 |
|
sl@0
|
98 |
public:
|
sl@0
|
99 |
|
sl@0
|
100 |
|
sl@0
|
101 |
public:
|
sl@0
|
102 |
|
sl@0
|
103 |
private:
|
sl@0
|
104 |
CUT_PBASE_T_USBDI_1235(TBool aHostRole);
|
sl@0
|
105 |
void ConstructL();
|
sl@0
|
106 |
void ExecuteHostTestCaseL();
|
sl@0
|
107 |
void ExecuteDeviceTestCaseL();
|
sl@0
|
108 |
void HostDoCancel();
|
sl@0
|
109 |
void DeviceDoCancel();
|
sl@0
|
110 |
void HostRunL();
|
sl@0
|
111 |
void DeviceRunL();
|
sl@0
|
112 |
|
sl@0
|
113 |
|
sl@0
|
114 |
private:
|
sl@0
|
115 |
|
sl@0
|
116 |
void SuspendDeviceByInterfacesAndCancelWaitForResume();
|
sl@0
|
117 |
void SendEp0Request(); // for b device stop
|
sl@0
|
118 |
|
sl@0
|
119 |
|
sl@0
|
120 |
private:
|
sl@0
|
121 |
|
sl@0
|
122 |
CActorFDF* iActorFDF;
|
sl@0
|
123 |
CEp0Transfer* iControlEp0;
|
sl@0
|
124 |
RUsbInterface iUsbInterface0;
|
sl@0
|
125 |
RUsbInterface iUsbInterface1;
|
sl@0
|
126 |
CInterfaceWatcher* iInterface0Watcher;
|
sl@0
|
127 |
CInterfaceWatcher* iInterface1Watcher;
|
sl@0
|
128 |
TBool iSuspendedI0;
|
sl@0
|
129 |
TBool iSuspendedI1;
|
sl@0
|
130 |
TUint iDeviceHandle;
|
sl@0
|
131 |
|
sl@0
|
132 |
RUsbDeviceA* iTestDevice;
|
sl@0
|
133 |
TCaseSteps iCaseStep;
|
sl@0
|
134 |
|
sl@0
|
135 |
|
sl@0
|
136 |
private:
|
sl@0
|
137 |
/**
|
sl@0
|
138 |
The functor for this test case for the factory
|
sl@0
|
139 |
*/
|
sl@0
|
140 |
const static TFunctorTestCase<CUT_PBASE_T_USBDI_1235,TBool> iFunctor;
|
sl@0
|
141 |
};
|
sl@0
|
142 |
|
sl@0
|
143 |
}
|
sl@0
|
144 |
|
sl@0
|
145 |
#endif
|