diff --git a/devtools/server/tests/xpcshell/head_dbg.js b/devtools/server/tests/xpcshell/head_dbg.js index 8c7d98a84239..a9b214569898 100644 --- a/devtools/server/tests/xpcshell/head_dbg.js +++ b/devtools/server/tests/xpcshell/head_dbg.js @@ -346,16 +346,8 @@ var listener = { Services.console.registerListener(listener); -function testGlobal(name) { - const sandbox = Cu.Sandbox( - Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal) - ); - sandbox.__name = name; - return sandbox; -} - function addTestGlobal(name, server = DevToolsServer) { - const global = testGlobal(name); + const global = createTestGlobal(name); server.addTestGlobal(global); return global; } diff --git a/devtools/server/tests/xpcshell/test_getyoungestframe.js b/devtools/server/tests/xpcshell/test_getyoungestframe.js index 9684211b5c9a..ec3b52524b77 100644 --- a/devtools/server/tests/xpcshell/test_getyoungestframe.js +++ b/devtools/server/tests/xpcshell/test_getyoungestframe.js @@ -11,7 +11,7 @@ function run_test() { const xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService( Ci.nsIJSInspector ); - const g = testGlobal("test1"); + const g = createTestGlobal("test1"); const dbg = makeDebugger(); dbg.uncaughtExceptionHook = testExceptionHook; diff --git a/devtools/server/tests/xpcshell/test_nativewrappers.js b/devtools/server/tests/xpcshell/test_nativewrappers.js index 7e95a2283648..629b050e3264 100644 --- a/devtools/server/tests/xpcshell/test_nativewrappers.js +++ b/devtools/server/tests/xpcshell/test_nativewrappers.js @@ -8,7 +8,7 @@ function run_test() { "resource://gre/modules/jsdebugger.jsm" ); addDebuggerToGlobal(this); - const g = testGlobal("test1"); + const g = createTestGlobal("test1"); const dbg = makeDebugger(); dbg.addDebuggee(g); @@ -24,7 +24,7 @@ function run_test() { g.eval("function stopMe(arg) {debugger;}"); - const g2 = testGlobal("test2"); + const g2 = createTestGlobal("test2"); g2.g = g; // Not using the "stringify a function" trick because that runs afoul of the // Cu.importGlobalProperties lint and we don't need it here anyway. diff --git a/devtools/server/tests/xpcshell/test_promises_run_to_completion.js b/devtools/server/tests/xpcshell/test_promises_run_to_completion.js index 76711a61e152..4d1e8745fee0 100644 --- a/devtools/server/tests/xpcshell/test_promises_run_to_completion.js +++ b/devtools/server/tests/xpcshell/test_promises_run_to_completion.js @@ -36,7 +36,9 @@ const Debugger = require("Debugger"); function test_promises_run_to_completion() { - const g = testGlobal("test global for test_promises_run_to_completion.js"); + const g = createTestGlobal( + "test global for test_promises_run_to_completion.js" + ); const dbg = new Debugger(g); g.Assert = Assert; const log = [""]; diff --git a/devtools/server/tests/xpcshell/test_safe-getter.js b/devtools/server/tests/xpcshell/test_safe-getter.js index 32aad6f9b835..06bbdd0781ff 100644 --- a/devtools/server/tests/xpcshell/test_safe-getter.js +++ b/devtools/server/tests/xpcshell/test_safe-getter.js @@ -8,7 +8,7 @@ function run_test() { "resource://gre/modules/jsdebugger.jsm" ); addDebuggerToGlobal(this); - const g = testGlobal("test"); + const g = createTestGlobal("test"); const dbg = new Debugger(); const gw = dbg.addDebuggee(g);