browser_webconsole_promise.js 810 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. // Bug 1148759 - Test the webconsole can display promises inside objects.
  5. "use strict";
  6. const TEST_URI = "data:text/html;charset=utf8,test for console and promises";
  7. var inputTests = [
  8. // 0
  9. {
  10. input: "({ x: Promise.resolve() })",
  11. output: "Object { x: Promise }",
  12. printOutput: "[object Object]",
  13. inspectable: true,
  14. variablesViewLabel: "Object"
  15. },
  16. ];
  17. function test() {
  18. requestLongerTimeout(2);
  19. Task.spawn(function* () {
  20. let {tab} = yield loadTab(TEST_URI);
  21. let hud = yield openConsole(tab);
  22. return checkOutputForInputs(hud, inputTests);
  23. }).then(finishUp);
  24. }
  25. function finishUp() {
  26. finishTest();
  27. }