test_bug335375.xul 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  3. <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
  4. <?xul-overlay href="overlay1_bug335375.xul"?>
  5. <?xul-overlay href="overlay2_bug335375.xul"?>
  6. <!--
  7. https://bugzilla.mozilla.org/show_bug.cgi?id=335375
  8. -->
  9. <window title="Mozilla Bug 335375"
  10. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  11. onload="RunTest();">
  12. <script type="application/javascript"
  13. src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  14. <script type="application/javascript">
  15. <![CDATA[
  16. SimpleTest.waitForExplicitFinish();
  17. function RunTest()
  18. {
  19. var cmd = document.getElementById("cmd_test");
  20. var button = document.getElementById("button_test");
  21. is(cmd.getAttribute("accesskey"), "C",
  22. "checking command has an accesskey");
  23. is(button.getAttribute("accesskey"), cmd.getAttribute("accesskey"),
  24. "checking command and button have the same accesskey");
  25. cmd.setAttribute("accesskey", "D");
  26. is(button.getAttribute("accesskey"), "D",
  27. "checking button has inherited new accesskey from command");
  28. SimpleTest.finish();
  29. }
  30. ]]>
  31. </script>
  32. <body xmlns="http://www.w3.org/1999/xhtml">
  33. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=335375"
  34. target="_blank">Mozilla Bug 335375</a>
  35. <p id="display"></p>
  36. <div id="content" style="display: none"></div>
  37. <pre id="test"></pre>
  38. </body>
  39. <commandset id="test_commandset"/>
  40. <toolbarbutton id="button_test"/>
  41. </window>