test_defaultpresetprovider.js
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN NIGHTINGALE GPL
4 //
5 // This file is part of the Nightingale web player.
6 //
7 // http://getnightingale.com
8 //
9 // This file may be licensed under the terms of of the
10 // GNU General Public License Version 2 (the "GPL").
11 //
12 // Software distributed under the License is distributed
13 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
14 // express or implied. See the GPL for the specific language
15 // governing rights and limitations.
16 //
17 // You should have received a copy of the GPL along with this
18 // program. If not, go to http://www.gnu.org/licenses/gpl.html
19 // or write to the Free Software Foundation, Inc.,
20 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 //
22 // END NIGHTINGALE GPL
23 //
24 */
25 
26 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
27 Components.utils.import("resource://app/jsmodules/ArrayConverter.jsm");
28 
29 if (typeof(Cc) == "undefined")
30  this.Cc = Components.classes;
31 if (typeof(Ci) == "undefined")
32  this.Ci = Components.interfaces;
33 
34 function runTest() {
35  var defaultProvider = Cc["@getnightingale.com/equalizer-presets/defaults;1"]
36  .getService(Ci.ngIEqualizerPresetProvider);
37 
38  var presets = defaultProvider.presets;
39  assertTrue(presets instanceof Ci.nsIArray, "Presets aren't an nsIArray");
40  assertEqual(presets.length, 17, "Preset number in default provider is off");
41 
42  return;
43 }
const Cc
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Advanced DataRemote unit tests.
const Ci