mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-26 12:59:23 -10:00
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
function test() {
|
|
addTab().then(function(data) {
|
|
data.target.makeRemote().then(performChecks.bind(null, data));
|
|
}).then(null, console.error);
|
|
|
|
function performChecks(data) {
|
|
let toolIds = gDevTools.getToolDefinitionArray()
|
|
.filter(def => def.isTargetSupported(data.target))
|
|
.map(def => def.id);
|
|
|
|
let open = function(index) {
|
|
let toolId = toolIds[index];
|
|
|
|
info("About to open " + index + "/" + toolId);
|
|
gDevTools.showToolbox(data.target, toolId).then(function(toolbox) {
|
|
ok(toolbox, "toolbox exists for " + toolId);
|
|
is(toolbox.currentToolId, toolId, "currentToolId should be " + toolId);
|
|
|
|
let panel = toolbox.getCurrentPanel();
|
|
ok(panel.isReady, toolId + " panel should be ready");
|
|
|
|
let nextIndex = index + 1;
|
|
if (nextIndex >= toolIds.length) {
|
|
toolbox.destroy().then(function() {
|
|
gBrowser.removeCurrentTab();
|
|
finish();
|
|
});
|
|
}
|
|
else {
|
|
open(nextIndex);
|
|
}
|
|
}, console.error);
|
|
};
|
|
|
|
open(0);
|
|
}
|
|
}
|