26 const Cu = Components.utils;
29 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
31 Cu.import(
"resource://app/jsmodules/ArrayConverter.jsm");
34 var
url =
"data:application/vnd.mozilla.xul+xml," +
35 "<?xml-stylesheet href='chrome://global/skin' type='text/css'?>" +
36 "<?xml-stylesheet href='chrome://songbird/content/bindings/bindings.css' type='text/css'?>" +
37 "<window xmlns='"+
XUL_NS+
"'/>";
48 function createElement(aType) {
50 element.setAttribute(
"flex",
"1");
51 document.documentElement.appendChild(element);
59 var currentPreset = aPresetList.preset;
61 assertEqual(currentPreset, aPresetList.preset,
"Saving the preset changed its name");
62 var resetButton = aPresetList.ownerDocument.getAnonymousElementByAttribute(aPresetList,
"anonid",
"eq-preset-reset");
63 assertTrue(!resetButton.hasAttribute(
"disabled") && !resetButton.hasAttribute(
"hidden"),
"Reset button hasn't been activated")
69 var currentPreset = aPresetList.preset;
71 assertEqual(currentPreset, aPresetList.preset,
"Deleting the preset changed its name (we saved an already existing preset and then deleted the custom version of it)");
72 var resetButton = aPresetList.ownerDocument.getAnonymousElementByAttribute(aPresetList,
"anonid",
"eq-preset-reset");
73 assertTrue(resetButton.hasAttribute(
"disabled") && resetButton.hasAttribute(
"hidden"),
"Reset button hasn't been disabled")
79 var eqPresets = ArrayConverter.JSArray(
Cc[
"@getnightingale.com/equalizer-presets/manager;1"]
80 .
getService(
Ci.ngIEqualizerPresetProviderManager).presets),
81 preset = aPresetList.preset,
84 if(item.QueryInterface(
Ci.ngIEqualizerPreset).name != preset) {
85 newPreset = item.QueryInterface(
Ci.ngIEqualizerPreset).name;
89 }),
"No eq preset with a different name than the current name was found");
90 aPresetList.preset = newPreset;
91 assertEqual(aPresetList.preset, newPreset,
"EQ preset was not applied successfully");
93 Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
94 .getService(
Ci.sbIMediacoreManager).equalizer.currentPresetName = preset;
95 assertEqual(aPresetList.preset, preset,
"EQ preset change did not populate to GUI");
function endWindowTest(e)
function test_save(aPresetList)
function test_delete(aPresetList)
function beginWindowTest(url, continueFunction)
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
getService(Ci.sbIFaceplateManager)
function runTest()
Advanced DataRemote unit tests.
function test_change(aPresetList)
function continueWindowTest(fn, parameters)