equal
deleted
inserted
replaced
117 } |
117 } |
118 test.Printf(_L(" Connected to USB Manager.\n")); |
118 test.Printf(_L(" Connected to USB Manager.\n")); |
119 current_test_state = EUSBManConnected; |
119 current_test_state = EUSBManConnected; |
120 break; |
120 break; |
121 case EUSBManConnected: |
121 case EUSBManConnected: |
122 // Register as primary client. |
|
123 // *** Obsolete *** |
|
124 /* |
|
125 r = usbman->RegisterAsPrimarySession(); |
|
126 if (r != KErrNone) |
|
127 { |
|
128 test.Printf(_L(" Failed to register as primary client. Error = %d\n"), r); |
|
129 return r; |
|
130 } |
|
131 test.Printf(_L(" Registered as primary client.\n")); |
|
132 */ |
|
133 current_test_state = EPrimaryRegistered; |
122 current_test_state = EPrimaryRegistered; |
134 break; |
123 break; |
135 default: |
124 default: |
136 break; |
125 break; |
137 } |
126 } |
160 usbman->Stop(status); |
149 usbman->Stop(status); |
161 User::WaitForRequest(status); |
150 User::WaitForRequest(status); |
162 current_test_state = EPrimaryRegistered; |
151 current_test_state = EPrimaryRegistered; |
163 break; |
152 break; |
164 case EPrimaryRegistered: |
153 case EPrimaryRegistered: |
165 // *** Obsolete *** |
|
166 // usbman->DeregisterAsPrimarySession(); |
|
167 current_test_state = EUSBManConnected; |
154 current_test_state = EUSBManConnected; |
168 break; |
155 break; |
169 case EUSBManConnected: |
156 case EUSBManConnected: |
170 // Don't need to disconnect. |
157 // Don't need to disconnect. |
171 current_test_state = EUSBManCreated; |
158 current_test_state = EUSBManCreated; |
238 current_test_state = EUSBManStarted; |
225 current_test_state = EUSBManStarted; |
239 return KErrNone; |
226 return KErrNone; |
240 } |
227 } |
241 |
228 |
242 /** |
229 /** |
243 * Executes test B2 (as detailed in the USB Manager Test Specification). |
|
244 * No longer a relevant test. |
|
245 */ |
|
246 /*static TInt RunTest_B2() |
|
247 { |
|
248 TInt r; |
|
249 |
|
250 test.Next(_L("Test B2.\n")); |
|
251 |
|
252 // Perform common startup |
|
253 current_test_state = EStart; |
|
254 r = CommonStart(); |
|
255 if (r != KErrNone) |
|
256 return r; |
|
257 |
|
258 // Start the USB Manager |
|
259 TRequestStatus status; |
|
260 test.Printf(_L("Starting.\n")); |
|
261 usbman->Start(status); |
|
262 |
|
263 // Wait for specific time (has to be less than the time to process a start request) |
|
264 timer.After(status, CANCEL_START_REQ_DELAY); |
|
265 User::WaitForRequest(status); |
|
266 |
|
267 // Cancel the start request |
|
268 test.Printf(_L("Cancelling.\n")); |
|
269 usbman->StartCancel(); |
|
270 |
|
271 // Check service status |
|
272 test.Printf(_L("Checking service status.\n")); |
|
273 r = CheckServiceState(EUsbServiceIdle); |
|
274 if ( r != KErrNone) |
|
275 return r; |
|
276 |
|
277 return KErrNone; |
|
278 } |
|
279 */ |
|
280 /** |
|
281 * Executes test B3 (as detailed in the USB Manager Test Specification). |
230 * Executes test B3 (as detailed in the USB Manager Test Specification). |
282 */ |
231 */ |
283 static TInt RunTest_B3() |
232 static TInt RunTest_B3() |
284 { |
233 { |
285 TInt r; |
234 TInt r; |
311 return r; |
260 return r; |
312 |
261 |
313 return KErrNone; |
262 return KErrNone; |
314 } |
263 } |
315 |
264 |
316 /** |
|
317 * Executes test B4 (as detailed in the USB Manager Test Specification). |
|
318 * No longer a relevant test. |
|
319 */ |
|
320 /*static TInt RunTest_B4() |
|
321 { |
|
322 TInt r; |
|
323 |
|
324 test.Next(_L("Test B4.\n")); |
|
325 |
|
326 // Perform common startup |
|
327 current_test_state = EStart; |
|
328 r = CommonStart(); |
|
329 if (r != KErrNone) |
|
330 return r; |
|
331 |
|
332 // Start the USB Manager |
|
333 TRequestStatus status, timerStatus; |
|
334 usbman->Start(status); |
|
335 User::WaitForRequest(status); |
|
336 test.Printf(_L("Start completed with status %d\n"), status.Int()); |
|
337 current_test_state = EUSBManStarted; |
|
338 |
|
339 // Stop the USB Manager |
|
340 usbman->Stop(status); |
|
341 |
|
342 // Wait for specific time (has to be less than the time to process a start request) |
|
343 timer.After(timerStatus, CANCEL_STOP_REQ_DELAY); |
|
344 User::WaitForRequest(status, timerStatus); |
|
345 |
|
346 // Cancel the stop request |
|
347 usbman->StopCancel(); |
|
348 |
|
349 // Check service status |
|
350 r = CheckServiceState(EUsbServiceStarted); |
|
351 if ( r != KErrNone) |
|
352 return r; |
|
353 |
|
354 return KErrNone; |
|
355 } |
|
356 */ |
|
357 /** |
265 /** |
358 * Executes test B5 (as detailed in the USB Manager Test Specification). |
266 * Executes test B5 (as detailed in the USB Manager Test Specification). |
359 */ |
267 */ |
360 static TInt RunTest_B5() |
268 static TInt RunTest_B5() |
361 { |
269 { |
505 } |
413 } |
506 else |
414 else |
507 test.Printf(_L("Test B1 passed.\n\n")); |
415 test.Printf(_L("Test B1 passed.\n\n")); |
508 CommonCleanup(); |
416 CommonCleanup(); |
509 |
417 |
510 /* Depreciated test. |
|
511 err=RunTest_B2(); |
|
512 if (err != KErrNone) |
|
513 { |
|
514 test.Printf(_L("Test B2 failed, code: %d\n\n"), err); |
|
515 } |
|
516 else |
|
517 test.Printf(_L("Test B2 passed.\n\n")); |
|
518 CommonCleanup(); |
|
519 */ |
|
520 err=RunTest_B3(); |
418 err=RunTest_B3(); |
521 if (err != KErrNone) |
419 if (err != KErrNone) |
522 { |
420 { |
523 test.Printf(_L("Test B3 failed, code: %d\n\n"), err); |
421 test.Printf(_L("Test B3 failed, code: %d\n\n"), err); |
524 } |
422 } |
525 else |
423 else |
526 test.Printf(_L("Test B3 passed.\n\n")); |
424 test.Printf(_L("Test B3 passed.\n\n")); |
527 CommonCleanup(); |
425 CommonCleanup(); |
528 |
426 |
529 /* Depreciated test. |
|
530 err=RunTest_B4(); |
|
531 if (err != KErrNone) |
|
532 { |
|
533 test.Printf(_L("Test B4 failed, code: %d\n\n"), err); |
|
534 } |
|
535 else |
|
536 test.Printf(_L("Test B4 passed.\n\n")); |
|
537 CommonCleanup(); |
|
538 */ |
|
539 err=RunTest_B5(); |
427 err=RunTest_B5(); |
540 if (err != KErrNone) |
428 if (err != KErrNone) |
541 { |
429 { |
542 test.Printf(_L("Test B5 failed, code: %d\n\n"), err); |
430 test.Printf(_L("Test B5 failed, code: %d\n\n"), err); |
543 } |
431 } |