|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 // Ensure that the sources listed when debugging an addon are either from the |
|
5 // addon itself, or the SDK, with proper groups and labels. |
|
6 |
|
7 const ADDON_URL = EXAMPLE_URL + "addon3.xpi"; |
|
8 |
|
9 function test() { |
|
10 Task.spawn(function () { |
|
11 let addon = yield addAddon(ADDON_URL); |
|
12 let addonDebugger = yield initAddonDebugger(ADDON_URL); |
|
13 |
|
14 is(addonDebugger.title, "Debugger - browser_dbg_addon3", "Saw the right toolbox title."); |
|
15 |
|
16 // Check the inital list of sources is correct |
|
17 let groups = yield addonDebugger.getSourceGroups(); |
|
18 is(groups[0].name, "jid1-ami3akps3baaeg@jetpack", "Add-on code should be the first group"); |
|
19 is(groups[1].name, "Add-on SDK", "Add-on SDK should be the second group"); |
|
20 is(groups.length, 2, "Should be only two groups."); |
|
21 |
|
22 let sources = groups[0].sources; |
|
23 is(sources.length, 2, "Should be two sources"); |
|
24 ok(sources[0].url.endsWith("/jid1-ami3akps3baaeg@jetpack.xpi!/bootstrap.js"), "correct url for bootstrap code") |
|
25 is(sources[0].label, "bootstrap.js", "correct label for bootstrap code") |
|
26 is(sources[1].url, "resource://jid1-ami3akps3baaeg-at-jetpack/browser_dbg_addon3/lib/main.js", "correct url for add-on code") |
|
27 is(sources[1].label, "resources/browser_dbg_addon3/lib/main.js", "correct label for add-on code") |
|
28 |
|
29 ok(groups[1].sources.length > 10, "SDK modules are listed"); |
|
30 |
|
31 yield addonDebugger.destroy(); |
|
32 yield removeAddon(addon); |
|
33 finish(); |
|
34 }); |
|
35 } |