33 var deviceName =
"CD Rip";
38 var deviceManager =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;2"]
39 .getService(
Ci.sbIDeviceManager2);
41 function onDeviceEvent(aEvent) {
42 switch (aEvent.type) {
43 case Ci.sbIDeviceEvent.EVENT_DEVICE_READY:
44 if (sbDevice.currentStatus.currentState !=
45 Ci.sbIDevice.STATE_DISCONNECTED) {
46 sbDevice.disconnect();
49 case Ci.sbIDeviceEvent.EVENT_DEVICE_REMOVED:
50 deviceManager.removeEventListener(onDeviceEvent);
51 sbDevice.removeEventListener(onDeviceEvent);
56 deviceManager.QueryInterface(
Ci.sbIDeviceEventTarget)
57 .addEventListener(onDeviceEvent);
58 sbDevice.QueryInterface(
Ci.sbIDeviceEventTarget)
59 .addEventListener(onDeviceEvent);
function sbCreateDevice(deviceName, toc)
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
function sbMakeInstantJunk()
function runTest()
Advanced DataRemote unit tests.