Bug 859372 - Refactor testactors.js;r=past

This commit is contained in:
Eddy Bruel 2014-05-13 22:06:37 +02:00
parent e46321bf42
commit bec8fcca79
3 changed files with 14 additions and 7 deletions

View File

@ -185,7 +185,7 @@ function attachTestTabAndResume(aClient, aTitle, aCallback) {
function initTestDebuggerServer() function initTestDebuggerServer()
{ {
DebuggerServer.registerModule("devtools/server/actors/script"); DebuggerServer.registerModule("devtools/server/actors/script");
DebuggerServer.addActors("resource://test/testactors.js"); DebuggerServer.registerModule("xpcshell-test/testactors");
// Allow incoming connections. // Allow incoming connections.
DebuggerServer.init(function () { return true; }); DebuggerServer.init(function () { return true; });
} }
@ -193,7 +193,7 @@ function initTestDebuggerServer()
function initTestTracerServer() function initTestTracerServer()
{ {
DebuggerServer.registerModule("devtools/server/actors/script"); DebuggerServer.registerModule("devtools/server/actors/script");
DebuggerServer.addActors("resource://test/testactors.js"); DebuggerServer.registerModule("xpcshell-test/testactors");
DebuggerServer.registerModule("devtools/server/actors/tracer"); DebuggerServer.registerModule("devtools/server/actors/tracer");
// Allow incoming connections. // Allow incoming connections.
DebuggerServer.init(function () { return true; }); DebuggerServer.init(function () { return true; });

View File

@ -25,7 +25,7 @@ function run_test()
check_except(DebuggerServer.closeListener); check_except(DebuggerServer.closeListener);
check_except(DebuggerServer.connectPipe); check_except(DebuggerServer.connectPipe);
DebuggerServer.addActors("resource://test/testactors.js"); DebuggerServer.registerModule("xpcshell-test/testactors");
// Now they should work. // Now they should work.
DebuggerServer.openListener(-1); DebuggerServer.openListener(-1);

View File

@ -1,11 +1,10 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */ http://creativecommons.org/publicdomain/zero/1.0/ */
const Cu = Components.utils;
const devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common"); const { ActorPool, appendExtraActors, createExtraActors } = require("devtools/server/actors/common");
const { RootActor } = devtools.require("devtools/server/actors/root"); const { RootActor } = require("devtools/server/actors/root");
const { ThreadActor } = devtools.require("devtools/server/actors/script"); const { ThreadActor } = require("devtools/server/actors/script");
const { DebuggerServer } = require("devtools/server/main");
var gTestGlobals = []; var gTestGlobals = [];
DebuggerServer.addTestGlobal = function(aGlobal) { DebuggerServer.addTestGlobal = function(aGlobal) {
@ -121,3 +120,11 @@ TestTabActor.prototype.requestTypes = {
"attach": TestTabActor.prototype.onAttach, "attach": TestTabActor.prototype.onAttach,
"detach": TestTabActor.prototype.onDetach "detach": TestTabActor.prototype.onDetach
}; };
exports.register = function(handle) {
handle.setRootActor(createRootActor);
};
exports.unregister = function(handle) {
handle.setRootActor(null);
};