Index: test/mjsunit/debug-backtrace.js |
=================================================================== |
--- test/mjsunit/debug-backtrace.js (revision 1840) |
+++ test/mjsunit/debug-backtrace.js (working copy) |
@@ -124,6 +124,23 @@ |
assertEquals(2, frames[1].index); |
assertEquals("", response.lookup(frames[1].func.ref).name); |
+ // Get backtrace with bottom two frames. |
+ json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFrame":0,"toFrame":2, "bottom":true}}' |
+ response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
+ backtrace = response.body(); |
+ assertEquals(1, backtrace.fromFrame); |
+ assertEquals(3, backtrace.toFrame); |
+ assertEquals(3, backtrace.totalFrames); |
+ var frames = backtrace.frames; |
+ assertEquals(2, frames.length); |
+ for (var i = 0; i < frames.length; i++) { |
+ assertEquals('frame', frames[i].type); |
+ } |
+ assertEquals(1, frames[0].index); |
+ assertEquals("g", response.lookup(frames[0].func.ref).name); |
+ assertEquals(2, frames[1].index); |
+ assertEquals("", response.lookup(frames[1].func.ref).name); |
+ |
// Get the individual frames. |
json = '{"seq":0,"type":"request","command":"frame"}' |
response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |