--- a/usbmgmt/usbmgrtest/t_whcm_cc/src/t_whcm_cc.cpp Tue Aug 31 17:01:47 2010 +0300
+++ b/usbmgmt/usbmgrtest/t_whcm_cc/src/t_whcm_cc.cpp Wed Sep 01 12:35:00 2010 +0100
@@ -117,6 +117,17 @@
current_test_state = EUSBManConnected;
break;
case EUSBManConnected:
+ // Register as primary client.
+ // *** Obsolete ***
+ /*
+ r = usbman->RegisterAsPrimarySession();
+ if (r != KErrNone)
+ {
+ test.Printf(_L(" Failed to register as primary client. Error = %d\n"), r);
+ return r;
+ }
+ test.Printf(_L(" Registered as primary client.\n"));
+ */
current_test_state = EPrimaryRegistered;
break;
default:
@@ -149,6 +160,8 @@
current_test_state = EPrimaryRegistered;
break;
case EPrimaryRegistered:
+ // *** Obsolete ***
+ // usbman->DeregisterAsPrimarySession();
current_test_state = EUSBManConnected;
break;
case EUSBManConnected:
@@ -224,6 +237,45 @@
return KErrNone;
}
+
+/**
+ * Executes test A2 (as detailed in the USB Manager Test Specification).
+ * No longer a relevant test.
+ */
+/*static TInt RunTest_A2()
+ {
+ TInt r;
+
+ test.Next(_L("Test A2.\n"));
+
+ // Perform common startup
+ current_test_state = EStart;
+ r = CommonStart();
+ if (r != KErrNone)
+ return r;
+
+ // Start the USB Manager
+ TRequestStatus status;
+ test.Printf(_L("Starting.\n"));
+ usbman->Start(status);
+
+ // Wait for specific time (has to be less than the time to process a start request)
+ timer.After(status, CANCEL_START_REQ_DELAY);
+ User::WaitForRequest(status);
+
+ // Cancel the start request
+ test.Printf(_L("Cancelling.\n"));
+ usbman->StartCancel();
+
+ // Check service status
+ test.Printf(_L("Checking service status.\n"));
+ r = CheckServiceState(EUsbServiceIdle);
+ if ( r != KErrNone)
+ return r;
+
+ return KErrNone;
+ }
+*/
/**
* Executes test A3 (as detailed in the USB Manager Test Specification).
*/
@@ -261,6 +313,47 @@
}
/**
+ * Executes test A4 (as detailed in the USB Manager Test Specification).
+ * No longer a relevant test.
+ */
+/*static TInt RunTest_A4()
+ {
+ TInt r;
+
+ test.Next(_L("Test A4.\n"));
+
+ // Perform common startup
+ current_test_state = EStart;
+ r = CommonStart();
+ if (r != KErrNone)
+ return r;
+
+ // Start the USB Manager
+ TRequestStatus status, timerStatus;
+ usbman->Start(status);
+ User::WaitForRequest(status);
+ test.Printf(_L("Start completed with status %d\n"), status.Int());
+ current_test_state = EUSBManStarted;
+
+ // Stop the USB Manager
+ usbman->Stop(status);
+
+ // Wait for specific time (has to be less than the time to process a start request)
+ timer.After(timerStatus, CANCEL_STOP_REQ_DELAY);
+ User::WaitForRequest(status, timerStatus);
+
+ // Cancel the stop request
+ usbman->StopCancel();
+
+ // Check service status
+ r = CheckServiceState(EUsbServiceStarted);
+ if ( r != KErrNone)
+ return r;
+
+ return KErrNone;
+ }
+*/
+/**
* Main function.
*
* Runs all the tests in order.
@@ -280,6 +373,16 @@
test.Printf(_L("Test A1 passed.\n\n"));
CommonCleanup();
+/* Depreciated test.
+ err=RunTest_A2();
+ if (err != KErrNone)
+ {
+ test.Printf(_L("Test A2 failed, code: %d\n\n"), err);
+ }
+ else
+ test.Printf(_L("Test A2 passed.\n\n"));
+ CommonCleanup();
+*/
err=RunTest_A3();
if (err != KErrNone)
{
@@ -289,7 +392,16 @@
test.Printf(_L("Test A3 passed.\n\n"));
CommonCleanup();
-
+/* Depreciated test.
+ err=RunTest_A4();
+ if (err != KErrNone)
+ {
+ test.Printf(_L("Test A4 failed, code: %d\n\n"), err);
+ }
+ else
+ test.Printf(_L("Test A4 passed.\n\n"));
+ CommonCleanup();
+*/
// Tests finished
}