Bug 859372 - Refactor testactors.js;r=past

This commit is contained in:
Eddy Bruel 2014-05-13 22:06:37 +02:00
Родитель ae7c69fc2c
Коммит eeb4ca4165
3 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -1,11 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
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 { RootActor } = devtools.require("devtools/server/actors/root");
const { ThreadActor } = devtools.require("devtools/server/actors/script");
const { RootActor } = require("devtools/server/actors/root");
const { ThreadActor } = require("devtools/server/actors/script");
const { DebuggerServer } = require("devtools/server/main");
var gTestGlobals = [];
DebuggerServer.addTestGlobal = function(aGlobal) {
@ -121,3 +120,11 @@ TestTabActor.prototype.requestTypes = {
"attach": TestTabActor.prototype.onAttach,
"detach": TestTabActor.prototype.onDetach
};
exports.register = function(handle) {
handle.setRootActor(createRootActor);
};
exports.unregister = function(handle) {
handle.setRootActor(null);
};