Bug 808791: JS debugger server environment form xpcshell tests r=past

This commit is contained in:
Jim Blandy 2013-01-14 16:15:58 -08:00
parent f2cbe8628b
commit efdf1bb2ae
2 changed files with 59 additions and 0 deletions

View File

@ -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\
");
}

View File

@ -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