34 var deviceName =
"TestCD";
38 var deviceManager =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;2"]
39 .getService(
Ci.sbIDeviceManager2);
41 var props =
Cc[
"@mozilla.org/hash-property-bag;1"]
42 .createInstance(
Ci.nsIWritablePropertyBag2);
47 function onDeviceEvent(aEvent) {
48 switch (aEvent.type) {
49 case Ci.sbIDeviceEvent.EVENT_DEVICE_READY:
50 if (sbDevice.currentStatus.currentState !=
51 Ci.sbIDevice.STATE_DISCONNECTED) {
52 sbDevice.disconnect();
55 case Ci.sbIDeviceEvent.EVENT_DEVICE_REMOVED:
56 deviceManager.removeEventListener(onDeviceEvent);
57 sbDevice.removeEventListener(onDeviceEvent);
62 deviceManager.QueryInterface(
Ci.sbIDeviceEventTarget)
63 .addEventListener(onDeviceEvent);
64 sbDevice.QueryInterface(
Ci.sbIDeviceEventTarget)
65 .addEventListener(onDeviceEvent);
function sbCreateDevice(deviceName, toc)
function assertTrue(aTest, aMessage)
function sbMakeInstantJunk()
function runTest()
Advanced DataRemote unit tests.