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 the sources listed when debugging an addon are either from the michael@0: // addon itself, or the SDK, with proper groups and labels. michael@0: michael@0: const ADDON_URL = EXAMPLE_URL + "addon3.xpi"; 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: is(addonDebugger.title, "Debugger - browser_dbg_addon3", "Saw the right toolbox title."); michael@0: michael@0: // Check the inital list of sources is correct michael@0: let groups = yield addonDebugger.getSourceGroups(); michael@0: is(groups[0].name, "jid1-ami3akps3baaeg@jetpack", "Add-on code should be the first group"); michael@0: is(groups[1].name, "Add-on SDK", "Add-on SDK should be the second group"); michael@0: is(groups.length, 2, "Should be only two groups."); michael@0: michael@0: let sources = groups[0].sources; michael@0: is(sources.length, 2, "Should be two sources"); michael@0: ok(sources[0].url.endsWith("/jid1-ami3akps3baaeg@jetpack.xpi!/bootstrap.js"), "correct url for bootstrap code") michael@0: is(sources[0].label, "bootstrap.js", "correct label for bootstrap code") michael@0: is(sources[1].url, "resource://jid1-ami3akps3baaeg-at-jetpack/browser_dbg_addon3/lib/main.js", "correct url for add-on code") michael@0: is(sources[1].label, "resources/browser_dbg_addon3/lib/main.js", "correct label for add-on code") michael@0: michael@0: ok(groups[1].sources.length > 10, "SDK modules are listed"); michael@0: michael@0: yield addonDebugger.destroy(); michael@0: yield removeAddon(addon); michael@0: finish(); michael@0: }); michael@0: }