browser_webconsole_inspect-parsed-documents.js 991 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. // Test that dynamically created (HTML|XML|SVG)Documents can be inspected by
  5. // clicking on the object in console (bug 1035198).
  6. "use strict";
  7. const TEST_CASES = [
  8. {
  9. input: '(new DOMParser()).parseFromString("<a />", "text/html")',
  10. output: "HTMLDocument",
  11. inspectable: true,
  12. },
  13. {
  14. input: '(new DOMParser()).parseFromString("<a />", "application/xml")',
  15. output: "XMLDocument",
  16. inspectable: true,
  17. },
  18. {
  19. input: '(new DOMParser()).parseFromString("<svg></svg>", "image/svg+xml")',
  20. output: "XMLDocument",
  21. inspectable: true,
  22. },
  23. ];
  24. const TEST_URI = "data:text/html;charset=utf8," +
  25. "browser_webconsole_inspect-parsed-documents.js";
  26. add_task(function* () {
  27. let {tab} = yield loadTab(TEST_URI);
  28. let hud = yield openConsole(tab);
  29. yield checkOutputForInputs(hud, TEST_CASES);
  30. });