Bug 808791: JS debugger server environment form xpcshell tests r=past
authorJim Blandy <jimb@mozilla.com>
Mon, 14 Jan 2013 16:15:58 -0800
changeset 118825 49e48938f65ce2d920a9e0d46c33cf9de7626cd6
parent 118824 2505111c4cee4b4ce4a0fd0553e2dc49ff6bb6bf
child 118826 ae9b3bb6b75a612f028c0e0d3799b65379f18acd
push id24180
push useremorley@mozilla.com
push dateTue, 15 Jan 2013 22:58:27 +0000
treeherdermozilla-central@72e34ce7fd92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs808791
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 808791: JS debugger server environment form xpcshell tests r=past
toolkit/devtools/debugger/tests/unit/test_framebindings-06.js
toolkit/devtools/debugger/tests/unit/xpcshell.ini
new file mode 100644
--- /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\
+        ");
+}
--- a/toolkit/devtools/debugger/tests/unit/xpcshell.ini
+++ b/toolkit/devtools/debugger/tests/unit/xpcshell.ini
@@ -85,16 +85,17 @@ reason = bug 820380
 [test_stepping-03.js]
 [test_stepping-04.js]
 [test_stepping-05.js]
 [test_framebindings-01.js]
 [test_framebindings-02.js]
 [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
 [test_pause_exceptions-02.js]
 skip-if = toolkit == "gonk"
 reason = bug 820380
 [test_longstringactor.js]
 [test_longstringgrips-01.js]