Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | // Adding a debuggee more than once is redundant. |
michael@0 | 2 | |
michael@0 | 3 | var dbg = new Debugger; |
michael@0 | 4 | var g = newGlobal(); |
michael@0 | 5 | var w = dbg.addDebuggee(g); |
michael@0 | 6 | assertEq(w instanceof Debugger.Object, true); |
michael@0 | 7 | |
michael@0 | 8 | function usual() { |
michael@0 | 9 | assertEq(dbg.hasDebuggee(g), true); |
michael@0 | 10 | assertEq(dbg.hasDebuggee(w), true); |
michael@0 | 11 | var arr = dbg.getDebuggees(); |
michael@0 | 12 | assertEq(arr.length, 1); |
michael@0 | 13 | assertEq(arr[0], w); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | usual(); |
michael@0 | 17 | assertEq(dbg.addDebuggee(g), w); |
michael@0 | 18 | usual(); |
michael@0 | 19 | assertEq(dbg.addDebuggee(w), w); |
michael@0 | 20 | usual(); |
michael@0 | 21 | |
michael@0 | 22 | // Removing the debuggee once is enough. |
michael@0 | 23 | assertEq(dbg.removeDebuggee(g), undefined); |
michael@0 | 24 | assertEq(dbg.hasDebuggee(g), false); |
michael@0 | 25 | assertEq(dbg.getDebuggees().length, 0); |