pointerevent_pointerup-manual.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>pointerup</title>
  5. <meta name="viewport" content="width=device-width">
  6. <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
  7. <script src="/resources/testharness.js"></script>
  8. <!--script src="/resources/testharnessreport.js"></script-->
  9. <!-- Additional helper script for common checks across event types -->
  10. <script type="text/javascript" src="pointerevent_support.js"></script>
  11. <script type="text/javascript" src="mochitest_support_internal.js"></script>
  12. </head>
  13. <body onload="run()">
  14. <h1>pointerup</h1>
  15. <h4>Test Description: This test checks if pointerup event triggers. Press mouse left button and release it over the black rectangle or tap it if you are using a touchscreen.</h4>
  16. <div id="target0" style="background:black"></div>
  17. <script>
  18. var detected_pointertypes = {};
  19. var test_pointerEvent = async_test("pointerup event received");
  20. // showPointerTypes is defined in pointerevent_support.js
  21. // Requirements: the callback function will reference the test_pointerEvent object and
  22. // will fail unless the async_test is created with the var name "test_pointerEvent".
  23. add_completion_callback(showPointerTypes);
  24. function run() {
  25. var target0 = document.getElementById("target0");
  26. on_event(target0, "pointerup", function (event) {
  27. detected_pointertypes[event.pointerType] = true;
  28. test_pointerEvent.step(function () {
  29. check_PointerEvent(event);
  30. assert_equals(event.type, "pointerup", "Pointer Event received.");
  31. });
  32. test_pointerEvent.done();
  33. });
  34. }
  35. </script>
  36. <h1>Pointer Events pointerup tests</h1>
  37. <div id="complete-notice">
  38. <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
  39. <p>Refresh the page to run the tests again with a different pointer type.</p>
  40. </div>
  41. <div id="log"></div>
  42. </body>
  43. </html>