1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/devtools/server/tests/unit/test_objectgrips-11.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +// Test that we get the magic properties on Error objects. 1.8 + 1.9 +var gDebuggee; 1.10 +var gClient; 1.11 +var gThreadClient; 1.12 + 1.13 +function run_test() 1.14 +{ 1.15 + initTestDebuggerServer(); 1.16 + gDebuggee = addTestGlobal("test-grips"); 1.17 + gDebuggee.eval(function stopMe(arg1) { 1.18 + debugger; 1.19 + }.toString()); 1.20 + 1.21 + gClient = new DebuggerClient(DebuggerServer.connectPipe()); 1.22 + gClient.connect(function() { 1.23 + attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) { 1.24 + gThreadClient = aThreadClient; 1.25 + test_object_grip(); 1.26 + }); 1.27 + }); 1.28 + do_test_pending(); 1.29 +} 1.30 + 1.31 +function test_object_grip() 1.32 +{ 1.33 + gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { 1.34 + let args = aPacket.frame.arguments; 1.35 + 1.36 + let objClient = gThreadClient.pauseGrip(args[0]); 1.37 + objClient.getOwnPropertyNames(function(aResponse) { 1.38 + var opn = aResponse.ownPropertyNames; 1.39 + do_check_eq(opn.length, 5); 1.40 + opn.sort(); 1.41 + do_check_eq(opn[0], "columnNumber"); 1.42 + do_check_eq(opn[1], "fileName"); 1.43 + do_check_eq(opn[2], "lineNumber"); 1.44 + do_check_eq(opn[3], "message"); 1.45 + do_check_eq(opn[4], "stack"); 1.46 + 1.47 + gThreadClient.resume(function() { 1.48 + finishClient(gClient); 1.49 + }); 1.50 + }); 1.51 + 1.52 + }); 1.53 + 1.54 + gDebuggee.eval("stopMe(new TypeError('error message text'))"); 1.55 +} 1.56 +