b=421005, r=gavin, a=damons. FUEL Preference.type uses undefined variables

This commit is contained in:
mark.finkle@gmail.com 2008-03-05 18:27:59 -08:00
Родитель 17c992a3f5
Коммит 7bda30d295
2 изменённых файлов: 43 добавлений и 31 удалений

Просмотреть файл

@ -302,7 +302,7 @@ Preference.prototype = {
get type() {
var value = "";
var type = this._prefs.getPrefType(name);
var type = this.branch._prefs.getPrefType(this._name);
switch (type) {
case Ci.nsIPrefBranch2.PREF_STRING:

Просмотреть файл

@ -31,7 +31,7 @@ function test() {
// test resetting a pref [since there is no default value, the pref should disappear]
Application.prefs.get(testdata.dummy).reset();
var itemValue = Application.prefs.getValue(testdata.dummy, "default");
itemValue = Application.prefs.getValue(testdata.dummy, "default");
is(itemValue, "default", "Check 'Application.prefs.getValue' for reset pref");
// test to see if a non-existant property exists
@ -55,6 +55,10 @@ function test() {
var val = Application.prefs.getValue(testdata.string, "default");
is(val, "#EF0000", "Set existing string property");
// test getting the type of an existing string property
var type = Application.prefs.get(testdata.string).type;
is(type, "String", "Check 'Application.prefs.get().type' for string pref");
// test resetting an existing string property
Application.prefs.get(testdata.string).reset();
var val = Application.prefs.getValue(testdata.string, "default");
@ -78,6 +82,10 @@ function test() {
var val = Application.prefs.getValue(testdata.integer, 1);
is(val, 0, "Set existing integer property");
// test getting the type of an existing integer property
var type = Application.prefs.get(testdata.integer).type;
is(type, "Number", "Check 'Application.prefs.get().type' for integer pref");
// test resetting an existing integer property
Application.prefs.get(testdata.integer).reset();
var val = Application.prefs.getValue(testdata.integer, 0);
@ -101,6 +109,10 @@ function test() {
var val = Application.prefs.getValue(testdata.boolean, true);
ok(!val, "Set existing boolean property");
// test getting the type of an existing boolean property
var type = Application.prefs.get(testdata.boolean).type;
is(type, "Boolean", "Check 'Application.prefs.get().type' for boolean pref");
// test resetting an existing boolean property
Application.prefs.get(testdata.boolean).reset();
var val = Application.prefs.getValue(testdata.boolean, false);