test_bug760131.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=760131
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 760131</title>
  9. <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=760131">Mozilla Bug 760131</a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none">
  16. <iframe id="frame"></iframe>
  17. </div>
  18. <pre id="test">
  19. <script type="application/javascript">
  20. /** Test for Bug 760131 **/
  21. var frame = document.getElementById("frame");
  22. function runTest()
  23. {
  24. var win = frame.contentWindow;
  25. win.wrappedJSObject.ok = ok;
  26. var doc = win.document;
  27. var empty = doc.createTouchList();
  28. var event = doc.createEvent("touchevent");
  29. event.initTouchEvent("touchstart", true, true, win, 0, false, false, false, false, empty, empty, empty);
  30. doc.getElementById("target").dispatchEvent(event);
  31. SimpleTest.finish();
  32. }
  33. SimpleTest.waitForExplicitFinish();
  34. frame.onload = runTest;
  35. frame.src = "http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_bug760131.html";
  36. </script>
  37. </pre>
  38. </body>
  39. </html>