Bug 1403961, part 1 - Don't load test_ipcshell_child.js from test_ipcshell.js. r=billm draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 29 Sep 2017 09:52:23 -0700
changeset 672840 d8d438b11f30e09c9978715ba71b12c4aebd11d8
parent 672839 4c73b87ba866d42db5c0ba2184e6f5db8200c62f
child 672841 fe7943291454a7c976f22f6a35595d000105669f
push id82385
push userbmo:continuation@gmail.com
push dateFri, 29 Sep 2017 20:03:38 +0000
reviewersbillm
bugs1403961
milestone58.0a1
Bug 1403961, part 1 - Don't load test_ipcshell_child.js from test_ipcshell.js. r=billm I don't fully understand what this test is trying to do, but as far as I can see, test_ipcshell_child.js does nothing when loaded from test_ipcshell.js besides define a few variables, so just define them directly in test_ipcshell.js. I am doing this because eslint does not like the way the test is currently written: the definition of runtime in another file confuses it, and it does not like the assignment to run_test. MozReview-Commit-ID: Ek0HY9n49eZ
ipc/testshell/tests/test_ipcshell.js
ipc/testshell/tests/test_ipcshell_child.js
--- a/ipc/testshell/tests/test_ipcshell.js
+++ b/ipc/testshell/tests/test_ipcshell.js
@@ -1,8 +1,13 @@
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+
+const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
+
 function callback(result) {
   do_check_eq(result, Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
   do_test_finished();
 }
 
 function run_test() {
   do_test_pending();
 
@@ -19,10 +24,8 @@ function run_test() {
       sendCommand(
           "'"+ pair[0] +"'.localeCompare('"+ pair[1] +"');",
           function (result) {
               do_check_eq(cmp, result);
               do_test_finished(); 
           });
     })
 }
-load('test_ipcshell_child.js');
-
--- a/ipc/testshell/tests/test_ipcshell_child.js
+++ b/ipc/testshell/tests/test_ipcshell_child.js
@@ -1,9 +1,8 @@
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 
 const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
 
-if (typeof(run_test) == "undefined") {
-  run_test = function() {
-    do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
-  }
}
+function run_test() {
+  do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
+}