diff --git a/modules/libpref/test/unit_ipc/test_update_prefs.js b/modules/libpref/test/unit_ipc/test_update_prefs.js index 07e93efd214..1b952c93d83 100644 --- a/modules/libpref/test/unit_ipc/test_update_prefs.js +++ b/modules/libpref/test/unit_ipc/test_update_prefs.js @@ -18,8 +18,21 @@ function run_test() { pb.setIntPref("Test.IPC.int.new", 23); pb.setCharPref("Test.IPC.char.new", "hey"); - run_test_in_child("test_observed_prefs.js"); - } - else { + run_test_in_child("test_observed_prefs.js", testPrefClear); } +} + +function testPrefClear() { + var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); + pb.clearUserPref("Test.IPC.bool.new"); + + sendCommand( +'var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);\n'+ +'pb.prefHasUserValue("Test.IPC.bool.new");\n', + checkWasCleared); +} + +function checkWasCleared(existsStr) { + do_check_eq(existsStr, "false"); + do_test_finished(); } \ No newline at end of file