test_bug489532.html 835 B

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=489532
  5. -->
  6. <head>
  7. <title>Test for Bug 489532</title>
  8. <script src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=489532">Mozilla Bug 489532</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. </div>
  16. <pre id="test">
  17. <script>
  18. /** Test for Bug 489532 **/
  19. try {
  20. document.createElement("<div>");
  21. ok(false, "Should throw.")
  22. } catch (e) {
  23. is(e.name, "InvalidCharacterError",
  24. "Expected InvalidCharacterError.");
  25. ok(e instanceof DOMException, "Expected DOMException.");
  26. is(e.code, DOMException.INVALID_CHARACTER_ERR,
  27. "Expected INVALID_CHARACTER_ERR.");
  28. }
  29. </script>
  30. </pre>
  31. </body>
  32. </html>