From 6eeb4a082d05433244807f5e27f0abd673c2a14e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 14 Jan 2013 16:15:58 -0800 Subject: [PATCH] Bug 808791: JS debugger server environment form xpcshell tests r=past --- .../tests/unit/test_framebindings-06.js | 58 +++++++++++++++++++ .../devtools/debugger/tests/unit/xpcshell.ini | 1 + 2 files changed, 59 insertions(+) create mode 100644 toolkit/devtools/debugger/tests/unit/test_framebindings-06.js diff --git a/toolkit/devtools/debugger/tests/unit/test_framebindings-06.js b/toolkit/devtools/debugger/tests/unit/test_framebindings-06.js new file mode 100644 index 00000000000..c0262a0a5ea --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_framebindings-06.js @@ -0,0 +1,58 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +var gDebuggee; +var gClient; +var gThreadClient; + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-grips"); + + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-grips", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_banana_environment(); + }); + }); + do_test_pending(); +} + +function test_banana_environment() +{ + + gThreadClient.addOneTimeListener("paused", + function(aEvent, aPacket) { + do_check_matches({type:"paused", frame: + {environment: + {type: "function", function: {name: "banana3"}, + parent: + {type: "block", bindings: {variables: {banana3:undefined}}, + parent: + {type: "function", function: {name: "banana2"}, + parent: + {type:"block", bindings: {variables: {banana2:undefined}}, + parent: + {type:"block", bindings: {variables: {banana2:undefined}}, + parent: + {type:"function", function: {name: "banana"}}}}}}}}}, + aPacket, + { Object:Object, Array:Array }); + gThreadClient.resume(function () { + finishClient(gClient); + }); + }); + + gDebuggee.eval("\ + function banana(x) { \n\ + return function banana2(y) { \n\ + return function banana3(z) { \n\ + debugger; \n\ + }; \n\ + }; \n\ + } \n\ + banana('x')('y')('z'); \n\ + "); +} diff --git a/toolkit/devtools/debugger/tests/unit/xpcshell.ini b/toolkit/devtools/debugger/tests/unit/xpcshell.ini index 19b4b01e504..4f71b3ca7d4 100644 --- a/toolkit/devtools/debugger/tests/unit/xpcshell.ini +++ b/toolkit/devtools/debugger/tests/unit/xpcshell.ini @@ -90,6 +90,7 @@ reason = bug 820380 [test_framebindings-03.js] [test_framebindings-04.js] [test_framebindings-05.js] +[test_framebindings-06.js] [test_pause_exceptions-01.js] skip-if = toolkit == "gonk" reason = bug 820380