1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/libpref/test/unit_ipc/test_observed_prefs.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +const Ci = Components.interfaces; 1.5 +const Cc = Components.classes; 1.6 + 1.7 +function isParentProcess() { 1.8 + let appInfo = Cc["@mozilla.org/xre/app-info;1"]; 1.9 + return (!appInfo || appInfo.getService(Ci.nsIXULRuntime).processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT); 1.10 +} 1.11 + 1.12 +function run_test() { 1.13 + if (isParentProcess() == false) { 1.14 + var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); 1.15 + do_check_eq(pb.getBoolPref("Test.IPC.bool.new"), true); 1.16 + do_check_eq(pb.getIntPref("Test.IPC.int.new"), 23); 1.17 + do_check_eq(pb.getCharPref("Test.IPC.char.new"), "hey"); 1.18 + } 1.19 +} 1.20 \ No newline at end of file