author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 256 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 2 |
// All rights reserved. |
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// @internalComponent |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include <e32std.h> |
|
19 |
#include <e32std_private.h> |
|
20 |
#include <u32std.h> // unicode builds |
|
21 |
#include <e32base.h> |
|
22 |
#include <e32base_private.h> |
|
23 |
#include <e32Test.h> // RTest headder |
|
24 |
#include "testcaseroot.h" |
|
25 |
#include "testcasewd.h" |
|
26 |
#include "testcase0676.h" |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
27 |
#include "OstTraceDefinitions.h" |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
#ifdef OST_TRACE_COMPILER_IN_USE |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
29 |
#include "testcase0676Traces.h" |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
30 |
#endif |
0 | 31 |
|
32 |
#define _REPEATS (oOpenIterations*3) |
|
33 |
||
34 |
||
35 |
||
36 |
// the name below is used to add a pointer to our construction method to a pointer MAP in |
|
37 |
// the class factory |
|
38 |
_LIT(KTestCaseId,"PBASE-USB_OTGDI-0676"); |
|
39 |
const TTestCaseFactoryReceipt<CTestCase0676> CTestCase0676::iFactoryReceipt(KTestCaseId); |
|
40 |
||
41 |
CTestCase0676* CTestCase0676::NewL(TBool aHost) |
|
42 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
43 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
44 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
45 |
OstTraceFunctionEntry0(CTESTCASE0676_NEWL); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
46 |
} |
0 | 47 |
CTestCase0676* self = new (ELeave) CTestCase0676(aHost); |
48 |
CleanupStack::PushL(self); |
|
49 |
self->ConstructL(); |
|
50 |
CleanupStack::Pop(self); |
|
51 |
return self; |
|
52 |
} |
|
53 |
||
54 |
||
55 |
CTestCase0676::CTestCase0676(TBool aHost) |
|
56 |
: CTestCaseRoot(KTestCaseId, aHost) |
|
57 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
OstTraceFunctionEntry0(CTESTCASE0676_CTESTCASE0676); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
} |
0 | 62 |
|
63 |
} |
|
64 |
||
65 |
||
66 |
/** |
|
67 |
ConstructL |
|
68 |
*/ |
|
69 |
void CTestCase0676::ConstructL() |
|
70 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
73 |
OstTraceFunctionEntry0(CTESTCASE0676_CONSTRUCTL); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
} |
0 | 75 |
iWDTimer = CTestCaseWatchdog::NewL(); |
76 |
iRepeats = OPEN_REPEATS; |
|
77 |
||
78 |
BaseConstructL(); |
|
79 |
} |
|
80 |
||
81 |
||
82 |
CTestCase0676::~CTestCase0676() |
|
83 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
OstTraceFunctionEntry0(CTESTCASE0676_DCTESTCASE0676); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
} |
0 | 88 |
|
89 |
Cancel(); |
|
90 |
delete iWDTimer; |
|
91 |
||
92 |
} |
|
93 |
||
94 |
||
95 |
void CTestCase0676::ExecuteTestCaseL() |
|
96 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
97 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
99 |
OstTraceFunctionEntry0(CTESTCASE0676_EXECUTETESTCASEL); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
} |
0 | 101 |
iCaseStep = EPreconditions; |
102 |
||
103 |
iRepeats = KOperationRetriesMax; // VBus event rise retries |
|
104 |
||
105 |
CActiveScheduler::Add(this); |
|
106 |
SelfComplete(); |
|
107 |
||
108 |
} |
|
109 |
||
110 |
||
111 |
void CTestCase0676::DoCancel() |
|
112 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
114 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
115 |
OstTraceFunctionEntry0(CTESTCASE0676_DOCANCEL); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
116 |
} |
0 | 117 |
|
118 |
// cancel our timer |
|
119 |
iTimer.Cancel(); |
|
120 |
} |
|
121 |
||
122 |
||
123 |
void CTestCase0676::CancelKB(CTestCaseRoot *pThis) |
|
124 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
125 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
126 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
OstTraceFunctionEntry0(CTESTCASE0676_CANCELKB); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
} |
0 | 129 |
CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis); |
130 |
// cancel any pending call, and then complete our active obj with a cancel value |
|
131 |
p->iConsole->ReadCancel(); |
|
132 |
||
133 |
} |
|
134 |
||
135 |
||
136 |
void CTestCase0676::CancelNotify(CTestCaseRoot *pThis) |
|
137 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
138 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
139 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
OstTraceFunctionEntry0(CTESTCASE0676_CANCELNOTIFY); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
} |
0 | 142 |
CTestCase0676 * p = REINTERPRET_CAST(CTestCase0676 *,pThis); |
143 |
// cancel any pending call, and then complete our active obj with a timeout value |
|
144 |
p->otgCancelOtgVbusNotification(); |
|
145 |
p->SelfComplete(KTestCaseWatchdogTO); |
|
146 |
} |
|
147 |
||
148 |
||
149 |
// This test result depends on all the ID detection tests and the VBus driving and dropping tests have not yet passed |
|
150 |
void CTestCase0676::DescribePreconditions() |
|
151 |
{ |
|
152 |
test.Printf(_L("Insert 'A' connector beforehand.\n")); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
153 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_DESCRIBEPRECONDITIONS, "Insert 'A' connector beforehand.\n"); |
0 | 154 |
} |
155 |
||
156 |
void CTestCase0676::ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps aStep) |
|
157 |
{ |
|
158 |
LOG_VERBOSE2(_L("Wait %dms before drop VBus"), (TInt)(aMicroSecs.Int()/1000)); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
OstTrace1(TRACE_VERBOSE, CTESTCASE0676_CONTINUEAFTER, "Wait %dms before drop VBus", (TInt)(aMicroSecs.Int()/1000));; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
} |
0 | 163 |
iTimer.After(iStatus, aMicroSecs); |
164 |
iCaseStep = aStep; |
|
165 |
SetActive(); |
|
166 |
} |
|
167 |
||
168 |
// handle event completion |
|
169 |
void CTestCase0676::RunStepL() |
|
170 |
{ |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
171 |
if(gVerboseOutput) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
172 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
173 |
OstTraceFunctionEntry0(CTESTCASE0676_RUNSTEPL); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
} |
0 | 175 |
// Obtain the completion code for this CActive obj. |
176 |
TInt completionCode(iStatus.Int()); |
|
177 |
TBuf<MAX_DSTRLEN> aDescription; |
|
178 |
TInt err(0); |
|
179 |
||
180 |
||
181 |
switch(iCaseStep) |
|
182 |
{ |
|
183 |
case EPreconditions: |
|
184 |
iCaseStep = ELoadLdd; |
|
185 |
if (iAutomated) |
|
186 |
{ |
|
187 |
iCaseStep = ELoadLdd; |
|
188 |
SelfComplete(); |
|
189 |
break; |
|
190 |
} |
|
191 |
// prompt to insert connector |
|
192 |
test.Printf(KInsertAConnectorPrompt); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP01, KInsertAConnectorPrompt); |
0 | 194 |
test.Printf(KPressAnyKeyToContinue); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
195 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP02, KPressAnyKeyToContinue); |
0 | 196 |
RequestCharacter(); |
197 |
break; |
|
198 |
||
199 |
case ELoadLdd: |
|
200 |
// 1. load the LDD and init. |
|
201 |
if (!StepLoadLDD()) |
|
202 |
{ |
|
203 |
break; |
|
204 |
} |
|
205 |
iCaseStep = EDetectAPlug; |
|
206 |
SelfComplete(); |
|
207 |
break; |
|
208 |
||
209 |
// 2. detect 'A' plug now |
|
210 |
case EDetectAPlug: |
|
211 |
if (KTestCaseWatchdogTO == iStatus.Int()) |
|
212 |
{ |
|
213 |
return TestFailed(KErrAbort, _L("User response too slow - FAILED!")); |
|
214 |
} |
|
215 |
||
216 |
// if doing this test in /AUTO mode, we would fail this now |
|
217 |
// however if we can control ID_PIN through an API in future, we turn in on now. |
|
218 |
if (!otgIdPinPresent()) |
|
219 |
{ |
|
220 |
test.Printf(KInsertAConnectorPrompt); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
221 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP03, KInsertAConnectorPrompt); |
0 | 222 |
test.Printf(KPressAnyKeyToContinue); |
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
223 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP04, KPressAnyKeyToContinue); |
0 | 224 |
RequestCharacter(); |
225 |
||
226 |
iCaseStep = EDetectAPlug; |
|
227 |
} |
|
228 |
else |
|
229 |
{ |
|
230 |
iCaseStep = ELoopDriveVBus; |
|
231 |
SelfComplete(); |
|
232 |
} |
|
233 |
break; |
|
234 |
||
235 |
// 3. Control/branch step in the loop |
|
236 |
case ELoopControl: |
|
237 |
if (--iRepeats) |
|
238 |
{ |
|
239 |
iCaseStep = ELoopDriveVBus; |
|
240 |
} |
|
241 |
else |
|
242 |
{ |
|
243 |
iCaseStep = EUnloadLdd; |
|
244 |
} |
|
245 |
SelfComplete(); |
|
246 |
break; |
|
247 |
||
248 |
case ELoopDriveVBus: |
|
249 |
// 4. DRIVE VBUS |
|
250 |
iWDTimer->Cancel(); |
|
251 |
test.Printf(_L("Drive VBus, iteration %d/%d\n"), OPEN_REPEATS-iRepeats+1, OPEN_REPEATS); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
OstTraceExt2(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP05, "Drive VBus, iteration %d/%d\n", OPEN_REPEATS-iRepeats+1, OPEN_REPEATS); |
0 | 253 |
// test for VBus rise next |
254 |
test.Printf(_L("Waiting for VBus Event\n")); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP06, "Waiting for VBus Event\n"); |
0 | 256 |
iStatus = KRequestPending; |
257 |
otgQueueOtgVbusNotification( iOTGVBus, iStatus ); |
|
258 |
||
259 |
// turn on VBus, since the call is not a Queing a-sync call we do this after the async call |
|
260 |
err = otgBusRequest(); // ok to turn on VBus now |
|
261 |
if (KErrNone != err) |
|
262 |
{ |
|
263 |
return TestFailed(KErrAbort, _L("Raise Vbus - RUsbOtgDriver::BusRequest() FAILED!")); |
|
264 |
} |
|
265 |
iCaseStep = ELoopVerifyVBus; |
|
266 |
iWDTimer->IssueRequest(KDelayDurationForLocalTrigger, this, &CancelNotify); |
|
267 |
SetActive(); |
|
268 |
break; |
|
269 |
||
270 |
case ELoopVerifyVBus: |
|
271 |
// 5. get VBus rise event |
|
272 |
if (KTestCaseWatchdogTO == iStatus.Int()) |
|
273 |
{ |
|
274 |
return TestFailed(KErrAbort, _L("Vbus rise not signalled in time - FAILED!")); |
|
275 |
} |
|
276 |
iWDTimer->Cancel(); |
|
277 |
||
278 |
otgQueueOtgVbusNotification( iOTGVBus, iStatus ); |
|
279 |
otgCancelOtgVbusNotification(); |
|
280 |
User::WaitForRequest(iStatus); |
|
281 |
||
282 |
||
283 |
if (iOTGVBus != RUsbOtgDriver::EVbusHigh) |
|
284 |
{ |
|
285 |
||
286 |
return TestFailed(KErrAbort, _L("Vbus rise NOT 'seen' - FAILED!")); |
|
287 |
} |
|
288 |
||
289 |
// Double-check using the API in a syncronous way too |
|
290 |
// NOTE: once again this is to explore timing issues |
|
291 |
if (!otgVbusPresent()) |
|
292 |
{ |
|
293 |
return TestFailed(KErrAbort, _L("Vbus syncronous call error - FAILED!")); |
|
294 |
} |
|
295 |
iCaseStep = ELoopWait; |
|
296 |
SelfComplete(); |
|
297 |
break; |
|
298 |
||
299 |
case ELoopWait: // 6. wait 50ms after applying Vbus before we are allowed to |
|
300 |
ContinueAfter(KDelayBeforeBusDropUs, ELoopDropVBus); |
|
301 |
break; |
|
302 |
||
303 |
case ELoopDropVBus: |
|
304 |
// 7. drop Bus |
|
305 |
otgQueueOtgVbusNotification(iOTGVBus, iStatus ); |
|
306 |
// drop Vbus now, since the call is not a Queing a-sync call we do this after the async call |
|
307 |
otgBusDrop(); |
|
308 |
SetActive(); |
|
309 |
iCaseStep = ELoopVerifyDrop; |
|
310 |
iWDTimer->IssueRequest(KDelayDurationForLocalTrigger, this, &CancelNotify); |
|
311 |
break; |
|
312 |
||
313 |
case ELoopVerifyDrop: |
|
314 |
// 8. get Vbus low event |
|
315 |
if (KTestCaseWatchdogTO == iStatus.Int()) |
|
316 |
{ |
|
317 |
return TestFailed(KErrAbort, _L("Vbus drop not signalled in time - FAILED!")); |
|
318 |
} |
|
319 |
iWDTimer->Cancel(); |
|
320 |
||
321 |
// fetch the value |
|
322 |
otgQueueOtgVbusNotification( iOTGVBus, iStatus ); |
|
323 |
otgCancelOtgVbusNotification(); |
|
324 |
User::WaitForRequest(iStatus); |
|
325 |
||
326 |
if (iOTGVBus != RUsbOtgDriver::EVbusLow) |
|
327 |
{ |
|
328 |
return TestFailed(KErrAbort, _L("Vbus drop NOT 'seen' - FAILED!")); |
|
329 |
} |
|
330 |
||
331 |
// test again using the 'syncronous' variation |
|
332 |
if (otgVbusPresent()) |
|
333 |
{ |
|
334 |
return TestFailed(KErrAbort, _L("Vbus syncronous call error - FAILED!")); |
|
335 |
} |
|
336 |
||
337 |
// wait 50ms and then go back to beginning |
|
338 |
ContinueAfter(KDelayBeforeBusDropUs, ELoopControl); |
|
339 |
break; |
|
340 |
||
341 |
case EUnloadLdd: |
|
342 |
// 9. unload |
|
343 |
if (EFalse == StepUnloadLDD()) |
|
344 |
return TestFailed(KErrAbort,_L("unload Ldd failure")); |
|
345 |
||
346 |
iCaseStep = ELastStep; |
|
347 |
SelfComplete(); |
|
348 |
break; |
|
349 |
||
350 |
case ELastStep: |
|
351 |
TestPassed(); |
|
352 |
break; |
|
353 |
||
354 |
default: |
|
355 |
test.Printf(_L("<Error> unknown test step")); |
|
256
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
356 |
OstTrace0(TRACE_NORMAL, CTESTCASE0676_RUNSTEPL_DUP07, "<Error> unknown test step"); |
0 | 357 |
Cancel(); |
358 |
return (TestFailed(KErrCorrupt, _L("<Error> unknown test step"))); |
|
359 |
} |
|
360 |
} |
|
361 |
||
362 |