зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1363539 - Remove dependency on DevTools from test_onGarbageCollection.html. r=sfink
MozReview-Commit-ID: LQ8oCAyC7sF --HG-- extra : rebase_source : 82284076bcff9fa34d7410b22ce90bb6182d3a09
This commit is contained in:
Родитель
172da9b6e3
Коммит
097e90a04c
|
@ -13,13 +13,18 @@
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
|
|
||||||
Cu.import("resource://devtools/shared/Loader.jsm");
|
|
||||||
const require = devtools.require;
|
|
||||||
|
|
||||||
const { gc } = Cu.getJSTestingFunctions();
|
const { gc } = Cu.getJSTestingFunctions();
|
||||||
|
|
||||||
const Debugger = require("Debugger");
|
// Instanciate `Debugger` in a sandbox as Debugger requires to be created
|
||||||
const dbg = new Debugger(this);
|
// in a compartment different than the debuggee.
|
||||||
|
let sandbox = Cu.Sandbox(Components.Constructor("@mozilla.org/systemprincipal;1", "nsIPrincipal")());
|
||||||
|
Cu.evalInSandbox(
|
||||||
|
"Components.utils.import('resource://gre/modules/jsdebugger.jsm');" +
|
||||||
|
"addDebuggerToGlobal(this);",
|
||||||
|
sandbox
|
||||||
|
);
|
||||||
|
|
||||||
|
const dbg = new sandbox.Debugger(this);
|
||||||
|
|
||||||
dbg.memory.onGarbageCollection = function (data) {
|
dbg.memory.onGarbageCollection = function (data) {
|
||||||
// Don't keep calling this hook after we finish.
|
// Don't keep calling this hook after we finish.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче