test_bug430392.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=430392
  5. -->
  6. <head>
  7. <title>Test for Bug 430392</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=430392">Mozilla Bug 430392</a>
  14. <p id="display"></p>
  15. <div id="content">
  16. <div contenteditable="true" id="edit"> <span contenteditable="false">A</span> ; <span contenteditable="false">B</span> ; <span contenteditable="false">C</span> </div>
  17. </div>
  18. <pre id="test">
  19. <script class="testbody" type="text/javascript">
  20. /** Test for Bug 430392 **/
  21. function test() {
  22. var edit = document.getElementById("edit");
  23. var html = edit.innerHTML;
  24. document.getElementById("edit").focus();
  25. synthesizeKey("VK_RIGHT", {});
  26. synthesizeKey("VK_RIGHT", {});
  27. synthesizeKey("VK_RETURN", {});
  28. synthesizeKey("VK_RETURN", {});
  29. synthesizeKey("VK_BACK_SPACE", {});
  30. synthesizeKey("VK_BACK_SPACE", {});
  31. is(edit.innerHTML, html,
  32. "adding and then deleting returns should not change text");
  33. SimpleTest.finish();
  34. }
  35. SimpleTest.waitForExplicitFinish();
  36. addLoadEvent(test);
  37. </script>
  38. </pre>
  39. </body>
  40. </html>