browser_webconsole_output_events.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. // Whitelisting this test.
  5. // As part of bug 1077403, the leaking uncaught rejection should be fixed.
  6. "use strict";
  7. thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
  8. // Test the webconsole output for DOM events.
  9. const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
  10. "test/test-console-output-events.html";
  11. add_task(function* () {
  12. yield loadTab(TEST_URI);
  13. let hud = yield openConsole();
  14. hud.jsterm.clearOutput();
  15. hud.jsterm.execute("testDOMEvents()");
  16. yield waitForMessages({
  17. webconsole: hud,
  18. messages: [{
  19. name: "testDOMEvents() output",
  20. text: "undefined",
  21. category: CATEGORY_OUTPUT,
  22. }],
  23. });
  24. yield waitForMessages({
  25. webconsole: hud,
  26. messages: [{
  27. name: "console.log() output for mousemove",
  28. text: /eventLogger mousemove { target: .+, buttons: 0, clientX: \d+, clientY: \d+, layerX: \d+, layerY: \d+ }/,
  29. category: CATEGORY_WEBDEV,
  30. severity: SEVERITY_LOG,
  31. }],
  32. });
  33. yield waitForMessages({
  34. webconsole: hud,
  35. messages: [{
  36. name: "console.log() output for keypress",
  37. text: /eventLogger keypress Shift { target: .+, key: .+, charCode: \d+, keyCode: \d+ }/,
  38. category: CATEGORY_WEBDEV,
  39. severity: SEVERITY_LOG,
  40. }],
  41. });
  42. });