ipc/testshell/tests/test_ipcshell.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/testshell/tests/test_ipcshell.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +function callback(result) {
     1.5 +  do_check_eq(result, Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
     1.6 +  do_test_finished();
     1.7 +}
     1.8 +
     1.9 +function run_test() {
    1.10 +  do_test_pending();
    1.11 +
    1.12 +  do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
    1.13 +
    1.14 +  sendCommand("load('test_ipcshell_child.js');");
    1.15 +
    1.16 +  sendCommand("runtime.processType;", callback);
    1.17 +
    1.18 +  [ [ "C", "D" ], [ "D", "C" ], [ "\u010C", "D" ], [ "D", "\u010C" ] ].forEach(
    1.19 +    function (pair) {
    1.20 +      do_test_pending();
    1.21 +      var cmp = pair[0].localeCompare(pair[1]);
    1.22 +      sendCommand(
    1.23 +          "'"+ pair[0] +"'.localeCompare('"+ pair[1] +"');",
    1.24 +          function (result) {
    1.25 +              do_check_eq(cmp, result);
    1.26 +              do_test_finished(); 
    1.27 +          });
    1.28 +    })
    1.29 +}
    1.30 +load('test_ipcshell_child.js');
    1.31 +

mercurial