michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Ensure that only panels that are relevant to the addon debugger michael@0: // display in the toolbox michael@0: michael@0: const ADDON_URL = EXAMPLE_URL + "addon3.xpi"; michael@0: michael@0: let gAddon, gClient, gThreadClient, gDebugger, gSources; michael@0: let PREFS = [ michael@0: "devtools.canvasdebugger.enabled", michael@0: "devtools.shadereditor.enabled", michael@0: "devtools.profiler.enabled", michael@0: "devtools.netmonitor.enabled" michael@0: ]; michael@0: function test() { michael@0: Task.spawn(function () { michael@0: let addon = yield addAddon(ADDON_URL); michael@0: let addonDebugger = yield initAddonDebugger(ADDON_URL); michael@0: michael@0: // Store and enable all optional dev tools panels michael@0: let originalPrefs = PREFS.map(pref => { michael@0: let original = Services.prefs.getBoolPref(pref); michael@0: Services.prefs.setBoolPref(pref, true) michael@0: return original; michael@0: }); michael@0: michael@0: let tabs = addonDebugger.frame.contentDocument.getElementById("toolbox-tabs").children; michael@0: let expectedTabs = ["options", "jsdebugger"]; michael@0: michael@0: is(tabs.length, 2, "displaying only 2 tabs in addon debugger"); michael@0: Array.forEach(tabs, (tab, i) => { michael@0: let toolName = expectedTabs[i]; michael@0: is(tab.getAttribute("toolid"), toolName, "displaying " + toolName); michael@0: }); michael@0: michael@0: yield addonDebugger.destroy(); michael@0: yield removeAddon(addon); michael@0: michael@0: PREFS.forEach((pref, i) => Services.prefs.setBoolPref(pref, originalPrefs[i])); michael@0: michael@0: finish(); michael@0: }); michael@0: }