test_framearguments-01.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Check a frame actor's arguments property.
  5. */
  6. var gDebuggee;
  7. var gClient;
  8. var gThreadClient;
  9. function run_test()
  10. {
  11. initTestDebuggerServer();
  12. gDebuggee = addTestGlobal("test-stack");
  13. gClient = new DebuggerClient(DebuggerServer.connectPipe());
  14. gClient.connect().then(function () {
  15. attachTestTabAndResume(gClient, "test-stack", function (aResponse, aTabClient, aThreadClient) {
  16. gThreadClient = aThreadClient;
  17. test_pause_frame();
  18. });
  19. });
  20. do_test_pending();
  21. }
  22. function test_pause_frame()
  23. {
  24. gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
  25. let args = aPacket.frame["arguments"];
  26. do_check_eq(args.length, 6);
  27. do_check_eq(args[0], 42);
  28. do_check_eq(args[1], true);
  29. do_check_eq(args[2], "nasu");
  30. do_check_eq(args[3].type, "null");
  31. do_check_eq(args[4].type, "undefined");
  32. do_check_eq(args[5].type, "object");
  33. do_check_eq(args[5].class, "Object");
  34. do_check_true(!!args[5].actor);
  35. gThreadClient.resume(function () {
  36. finishClient(gClient);
  37. });
  38. });
  39. gDebuggee.eval("(" + function () {
  40. function stopMe(aNumber, aBool, aString, aNull, aUndefined, aObject) {
  41. debugger;
  42. }
  43. stopMe(42, true, "nasu", null, undefined, { foo: "bar" });
  44. } + ")()");
  45. }