|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 var gDebuggee; |
|
5 var gClient; |
|
6 var gThreadClient; |
|
7 |
|
8 function run_test() |
|
9 { |
|
10 initTestDebuggerServer(); |
|
11 gDebuggee = addTestGlobal("test-grips"); |
|
12 gDebuggee.eval(function stopMe(arg1) { |
|
13 debugger; |
|
14 }.toString()); |
|
15 |
|
16 gClient = new DebuggerClient(DebuggerServer.connectPipe()); |
|
17 gClient.connect(function() { |
|
18 attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) { |
|
19 gThreadClient = aThreadClient; |
|
20 test_object_grip(); |
|
21 }); |
|
22 }); |
|
23 do_test_pending(); |
|
24 } |
|
25 |
|
26 function test_object_grip() |
|
27 { |
|
28 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { |
|
29 let args = aPacket.frame.arguments; |
|
30 |
|
31 do_check_eq(args[0].class, "Object"); |
|
32 |
|
33 let objClient = gThreadClient.pauseGrip(args[0]); |
|
34 objClient.getOwnPropertyNames(function(aResponse) { |
|
35 do_check_eq(aResponse.ownPropertyNames.length, 3); |
|
36 do_check_eq(aResponse.ownPropertyNames[0], "a"); |
|
37 do_check_eq(aResponse.ownPropertyNames[1], "b"); |
|
38 do_check_eq(aResponse.ownPropertyNames[2], "c"); |
|
39 |
|
40 gThreadClient.resume(function() { |
|
41 finishClient(gClient); |
|
42 }); |
|
43 }); |
|
44 |
|
45 }); |
|
46 |
|
47 gDebuggee.eval("stopMe({ a: 1, b: true, c: 'foo' })"); |
|
48 } |
|
49 |