32 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
41 var manager = Components.classes[
"@songbirdnest.com/Songbird/DeviceManager;2"]
42 .getService(Components.interfaces.sbIDeviceManager2);
44 manager.addEventListener(
onEvent);
46 var
event = manager.createEvent(Components.interfaces.sbIDeviceEvent.COMMAND_DEVICE_BASE);
47 manager.dispatchEvent(
event);
48 assertTrue(hasEvent,
"event listener not fired");
50 manager.removeEventListener(
onEvent);
52 event = manager.createEvent(
event.COMMAND_DEVICE_BASE);
53 manager.dispatchEvent(
event);
54 assertFalse(hasEvent,
"event listener not removed");
57 var eventTest = Components.classes[
"@songbirdnest.com/Songbird/Device/EventTester/StressThreads;1"]
58 .createInstance(Components.interfaces.nsIRunnable);
62 var eventTest = Components.classes[
"@songbirdnest.com/Songbird/Device/EventTester/Removal;1"]
63 .createInstance(Components.interfaces.nsIRunnable);
function assertTrue(aTest, aMessage)
function assertFalse(aTest, aMessage)
function runTest()
Advanced DataRemote unit tests.