Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Check that requesting a thread-lifetime actor twice for the same
6 * value returns the same actor.
7 */
9 var gDebuggee;
10 var gClient;
11 var gThreadClient;
13 function run_test()
14 {
15 initTestDebuggerServer();
16 gDebuggee = addTestGlobal("test-grips");
17 gClient = new DebuggerClient(DebuggerServer.connectPipe());
18 gClient.connect(function() {
19 attachTestTabAndResume(gClient, "test-grips", function (aResponse, aTabClient, aThreadClient) {
20 gThreadClient = aThreadClient;
21 test_thread_lifetime();
22 });
23 });
24 do_test_pending();
25 }
27 function test_thread_lifetime()
28 {
29 gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
30 let pauseGrip = aPacket.frame.arguments[0];
32 gClient.request({ to: pauseGrip.actor, type: "threadGrip" }, function (aResponse) {
33 // Successful promotion won't return an error.
34 do_check_eq(aResponse.error, undefined);
36 let threadGrip1 = aResponse.from;
38 gClient.request({ to: pauseGrip.actor, type: "threadGrip" }, function (aResponse) {
39 do_check_eq(threadGrip1, aResponse.from);
40 gThreadClient.resume(function() {
41 finishClient(gClient);
42 });
43 });
44 });
45 });
47 gDebuggee.eval("(" + function() {
48 function stopMe(arg1) {
49 debugger;
50 };
51 stopMe({obj: true});
52 } + ")()");
53 }