modules/libpref/test/unit_ipc/test_existing_prefs.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/libpref/test/unit_ipc/test_existing_prefs.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     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 +
    1.15 +    do_load_child_test_harness();
    1.16 + 
    1.17 +    var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
    1.18 +    pb.setBoolPref("Test.IPC.bool.new", true);
    1.19 +    pb.setIntPref("Test.IPC.int.new", 23);
    1.20 +    pb.setCharPref("Test.IPC.char.new", "hey");
    1.21 +
    1.22 +    run_test_in_child("test_observed_prefs.js");
    1.23 +  }
    1.24 +}
    1.25 \ No newline at end of file

mercurial