michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: addTab().then(function(data) { michael@0: data.target.makeRemote().then(performChecks.bind(null, data)); michael@0: }).then(null, console.error); michael@0: michael@0: function performChecks(data) { michael@0: let toolIds = gDevTools.getToolDefinitionArray() michael@0: .filter(def => def.isTargetSupported(data.target)) michael@0: .map(def => def.id); michael@0: michael@0: let open = function(index) { michael@0: let toolId = toolIds[index]; michael@0: michael@0: info("About to open " + index + "/" + toolId); michael@0: gDevTools.showToolbox(data.target, toolId).then(function(toolbox) { michael@0: ok(toolbox, "toolbox exists for " + toolId); michael@0: is(toolbox.currentToolId, toolId, "currentToolId should be " + toolId); michael@0: michael@0: let panel = toolbox.getCurrentPanel(); michael@0: ok(panel.isReady, toolId + " panel should be ready"); michael@0: michael@0: let nextIndex = index + 1; michael@0: if (nextIndex >= toolIds.length) { michael@0: toolbox.destroy().then(function() { michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: }); michael@0: } michael@0: else { michael@0: open(nextIndex); michael@0: } michael@0: }, console.error); michael@0: }; michael@0: michael@0: open(0); michael@0: } michael@0: }