modules/libpref/test/unit_ipc/test_initial_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_initial_prefs.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     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 +      pb.setBoolPref("Test.IPC.bool", true);
    1.16 +      pb.setIntPref("Test.IPC.int", 23);
    1.17 +      pb.setCharPref("Test.IPC.char", "hey");
    1.18 +
    1.19 +      run_test_in_child("test_existing_prefs.JS");
    1.20 +  }
    1.21 +}
    1.22 \ No newline at end of file

mercurial