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
--- 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);
+}