equal
deleted
inserted
replaced
115 } |
115 } |
116 test.Printf(_L(" Connected to USB Manager.\n")); |
116 test.Printf(_L(" Connected to USB Manager.\n")); |
117 current_test_state = EUSBManConnected; |
117 current_test_state = EUSBManConnected; |
118 break; |
118 break; |
119 case EUSBManConnected: |
119 case EUSBManConnected: |
|
120 // Register as primary client. |
|
121 // *** Obsolete *** |
|
122 /* |
|
123 r = usbman->RegisterAsPrimarySession(); |
|
124 if (r != KErrNone) |
|
125 { |
|
126 test.Printf(_L(" Failed to register as primary client. Error = %d\n"), r); |
|
127 return r; |
|
128 } |
|
129 test.Printf(_L(" Registered as primary client.\n")); |
|
130 */ |
120 current_test_state = EPrimaryRegistered; |
131 current_test_state = EPrimaryRegistered; |
121 break; |
132 break; |
122 default: |
133 default: |
123 break; |
134 break; |
124 } |
135 } |
147 usbman->Stop(status); |
158 usbman->Stop(status); |
148 User::WaitForRequest(status); |
159 User::WaitForRequest(status); |
149 current_test_state = EPrimaryRegistered; |
160 current_test_state = EPrimaryRegistered; |
150 break; |
161 break; |
151 case EPrimaryRegistered: |
162 case EPrimaryRegistered: |
|
163 // *** Obsolete *** |
|
164 // usbman->DeregisterAsPrimarySession(); |
152 current_test_state = EUSBManConnected; |
165 current_test_state = EUSBManConnected; |
153 break; |
166 break; |
154 case EUSBManConnected: |
167 case EUSBManConnected: |
155 // Don't need to disconnect. |
168 // Don't need to disconnect. |
156 current_test_state = EUSBManCreated; |
169 current_test_state = EUSBManCreated; |
222 |
235 |
223 current_test_state = EUSBManStarted; |
236 current_test_state = EUSBManStarted; |
224 return KErrNone; |
237 return KErrNone; |
225 } |
238 } |
226 |
239 |
|
240 |
|
241 /** |
|
242 * Executes test A2 (as detailed in the USB Manager Test Specification). |
|
243 * No longer a relevant test. |
|
244 */ |
|
245 /*static TInt RunTest_A2() |
|
246 { |
|
247 TInt r; |
|
248 |
|
249 test.Next(_L("Test A2.\n")); |
|
250 |
|
251 // Perform common startup |
|
252 current_test_state = EStart; |
|
253 r = CommonStart(); |
|
254 if (r != KErrNone) |
|
255 return r; |
|
256 |
|
257 // Start the USB Manager |
|
258 TRequestStatus status; |
|
259 test.Printf(_L("Starting.\n")); |
|
260 usbman->Start(status); |
|
261 |
|
262 // Wait for specific time (has to be less than the time to process a start request) |
|
263 timer.After(status, CANCEL_START_REQ_DELAY); |
|
264 User::WaitForRequest(status); |
|
265 |
|
266 // Cancel the start request |
|
267 test.Printf(_L("Cancelling.\n")); |
|
268 usbman->StartCancel(); |
|
269 |
|
270 // Check service status |
|
271 test.Printf(_L("Checking service status.\n")); |
|
272 r = CheckServiceState(EUsbServiceIdle); |
|
273 if ( r != KErrNone) |
|
274 return r; |
|
275 |
|
276 return KErrNone; |
|
277 } |
|
278 */ |
227 /** |
279 /** |
228 * Executes test A3 (as detailed in the USB Manager Test Specification). |
280 * Executes test A3 (as detailed in the USB Manager Test Specification). |
229 */ |
281 */ |
230 static TInt RunTest_A3() |
282 static TInt RunTest_A3() |
231 { |
283 { |
259 |
311 |
260 return KErrNone; |
312 return KErrNone; |
261 } |
313 } |
262 |
314 |
263 /** |
315 /** |
|
316 * Executes test A4 (as detailed in the USB Manager Test Specification). |
|
317 * No longer a relevant test. |
|
318 */ |
|
319 /*static TInt RunTest_A4() |
|
320 { |
|
321 TInt r; |
|
322 |
|
323 test.Next(_L("Test A4.\n")); |
|
324 |
|
325 // Perform common startup |
|
326 current_test_state = EStart; |
|
327 r = CommonStart(); |
|
328 if (r != KErrNone) |
|
329 return r; |
|
330 |
|
331 // Start the USB Manager |
|
332 TRequestStatus status, timerStatus; |
|
333 usbman->Start(status); |
|
334 User::WaitForRequest(status); |
|
335 test.Printf(_L("Start completed with status %d\n"), status.Int()); |
|
336 current_test_state = EUSBManStarted; |
|
337 |
|
338 // Stop the USB Manager |
|
339 usbman->Stop(status); |
|
340 |
|
341 // Wait for specific time (has to be less than the time to process a start request) |
|
342 timer.After(timerStatus, CANCEL_STOP_REQ_DELAY); |
|
343 User::WaitForRequest(status, timerStatus); |
|
344 |
|
345 // Cancel the stop request |
|
346 usbman->StopCancel(); |
|
347 |
|
348 // Check service status |
|
349 r = CheckServiceState(EUsbServiceStarted); |
|
350 if ( r != KErrNone) |
|
351 return r; |
|
352 |
|
353 return KErrNone; |
|
354 } |
|
355 */ |
|
356 /** |
264 * Main function. |
357 * Main function. |
265 * |
358 * |
266 * Runs all the tests in order. |
359 * Runs all the tests in order. |
267 */ |
360 */ |
268 void mainL() |
361 void mainL() |
278 } |
371 } |
279 else |
372 else |
280 test.Printf(_L("Test A1 passed.\n\n")); |
373 test.Printf(_L("Test A1 passed.\n\n")); |
281 CommonCleanup(); |
374 CommonCleanup(); |
282 |
375 |
|
376 /* Depreciated test. |
|
377 err=RunTest_A2(); |
|
378 if (err != KErrNone) |
|
379 { |
|
380 test.Printf(_L("Test A2 failed, code: %d\n\n"), err); |
|
381 } |
|
382 else |
|
383 test.Printf(_L("Test A2 passed.\n\n")); |
|
384 CommonCleanup(); |
|
385 */ |
283 err=RunTest_A3(); |
386 err=RunTest_A3(); |
284 if (err != KErrNone) |
387 if (err != KErrNone) |
285 { |
388 { |
286 test.Printf(_L("Test A3 failed, code: %d\n\n"), err); |
389 test.Printf(_L("Test A3 failed, code: %d\n\n"), err); |
287 } |
390 } |
288 else |
391 else |
289 test.Printf(_L("Test A3 passed.\n\n")); |
392 test.Printf(_L("Test A3 passed.\n\n")); |
290 CommonCleanup(); |
393 CommonCleanup(); |
291 |
394 |
292 |
395 /* Depreciated test. |
|
396 err=RunTest_A4(); |
|
397 if (err != KErrNone) |
|
398 { |
|
399 test.Printf(_L("Test A4 failed, code: %d\n\n"), err); |
|
400 } |
|
401 else |
|
402 test.Printf(_L("Test A4 passed.\n\n")); |
|
403 CommonCleanup(); |
|
404 */ |
293 // Tests finished |
405 // Tests finished |
294 } |
406 } |
295 |
407 |
296 /** |
408 /** |
297 * Entry point. |
409 * Entry point. |