tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_ipcshell.js (835B)


      1 // eslint-disable-next-line mozilla/use-services
      2 const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
      3 
      4 function callback(result) {
      5  Assert.equal(result, Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
      6  do_test_finished();
      7 }
      8 
      9 function run_test() {
     10  do_test_pending();
     11 
     12  Assert.equal(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
     13 
     14  sendCommand("load('test_ipcshell_child.js');");
     15 
     16  sendCommand("runtime.processType;", callback);
     17 
     18  [
     19    ["C", "D"],
     20    ["D", "C"],
     21    ["\u010C", "D"],
     22    ["D", "\u010C"],
     23  ].forEach(function (pair) {
     24    do_test_pending();
     25    var cmp = pair[0].localeCompare(pair[1]);
     26    sendCommand(
     27      "'" + pair[0] + "'.localeCompare('" + pair[1] + "');",
     28      function (result) {
     29        Assert.equal(cmp, result);
     30        do_test_finished();
     31      }
     32    );
     33  });
     34 }