From 9a8616c74f17ce1d30f8068ed645989888716f87 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 5 Jan 2011 22:54:47 -0600 Subject: [PATCH] Test for bug 616441. a=b --- .../test/unit_ipc/test_update_prefs.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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