mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
efe328f1b2
In a following patch, all DevTools moz.build files will use DevToolsModules to install JS modules at a path that corresponds directly to their source tree location. Here we rewrite all require and import calls to match the new location that these files are installed to. --HG-- extra : commitid : F2ItGm8ptRz extra : rebase_source : b082fe4bf77e22e297e303fc601165ceff1c4cbc
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
var Cu = Components.utils;
|
|
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
|
|
const {DebuggerClient} = require("devtools/shared/client/main");
|
|
const {DebuggerServer} = require("devtools/server/main");
|
|
const Services = require("Services");
|
|
|
|
// Always log packets when running tests.
|
|
Services.prefs.setBoolPref("devtools.debugger.log", true);
|
|
Services.prefs.setBoolPref("dom.mozBrowserFramesEnabled", true);
|
|
|
|
SimpleTest.registerCleanupFunction(function() {
|
|
Services.prefs.clearUserPref("devtools.debugger.log");
|
|
Services.prefs.clearUserPref("dom.mozBrowserFramesEnabled");
|
|
});
|
|
|
|
const {promiseInvoke} = require("devtools/shared/async-utils");
|
|
|
|
const { DirectorRegistry,
|
|
DirectorRegistryFront } = require("devtools/server/actors/director-registry");
|
|
|
|
const { DirectorManagerFront } = require("devtools/server/actors/director-manager");
|
|
|
|
const {Task} = require("resource://gre/modules/Task.jsm");
|
|
|
|
/***********************************
|
|
* director helpers functions
|
|
**********************************/
|
|
|
|
function* newConnectedDebuggerClient(opts) {
|
|
var transport = DebuggerServer.connectPipe();
|
|
var client = new DebuggerClient(transport);
|
|
|
|
yield promiseInvoke(client, client.connect);
|
|
|
|
var root = yield promiseInvoke(client, client.listTabs);
|
|
|
|
return {
|
|
client: client,
|
|
root: root,
|
|
transport: transport
|
|
};
|
|
}
|
|
|
|
function purgeInstalledDirectorScripts() {
|
|
DirectorRegistry.clear();
|
|
}
|