Skip to content

Commit

Permalink
Bug 903268 add a test for the case of getting a pref that dne and whe…
Browse files Browse the repository at this point in the history
…re we use no default value
  • Loading branch information
Erik Vold committed Feb 19, 2015
1 parent 0a78838 commit 791ea4f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test-preferences-service.js
Expand Up @@ -29,6 +29,17 @@ exports.testGetAndSet = function(assert) {
"preferences-service should read from " +
"application-wide preferences service");

// test getting a pref that does not exist,
// and where we provide no default
assert.equal(
prefs.get("test_dne_get_pref", "default"),
"default",
"default was used for a pref that does not exist");
assert.equal(
prefs.get("test_dne_get_pref"),
undefined,
"undefined was returned for a pref that does not exist with no default");

prefs.set("test_set_get_pref.integer", 1);
assert.equal(prefs.get("test_set_get_pref.integer"), 1,
"set/get integer preference should work");
Expand Down

0 comments on commit 791ea4f

Please sign in to comment.