OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>pointerout</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 </head> |
| 12 <body onload="run()"> |
| 13 <h2>pointerout</h2> |
| 14 <h4>Test Description: This test checks if pointerout event triggers for
pen. Place your pen over the black rectangle and then pull the pen out of the di
gitizer's detectable range. </h4> |
| 15 <p>Note: this test is for devices that support hover - for pen only</p> |
| 16 <div id="target0"></div> |
| 17 <script> |
| 18 var test_pointerout = async_test("pointerout event received"); |
| 19 // showPointerTypes is defined in pointerevent_support.js |
| 20 // Requirements: the callback function will reference the test_point
erEvent object and |
| 21 // will fail unless the async_test is created with the var name "tes
t_pointerEvent". |
| 22 add_completion_callback(showPointerTypes); |
| 23 |
| 24 var eventTested = false; |
| 25 var isPointerupReceived = false; |
| 26 var detected_pointertypes = {}; |
| 27 |
| 28 function run() { |
| 29 var target0 = document.getElementById("target0"); |
| 30 |
| 31 // When a pen stylus leaves the hover range detectable by the di
gitizer the pointerout event must be dispatched. |
| 32 // TA: 7.2 |
| 33 on_event(target0, "pointerout", function (event) { |
| 34 detected_pointertypes[event.pointerType] = true; |
| 35 if(event.pointerType == 'pen') { |
| 36 if (eventTested == false) { |
| 37 eventTested = true; |
| 38 test_pointerout.done(); |
| 39 } |
| 40 } |
| 41 else { |
| 42 test_pointerout.step(function() { |
| 43 assert_true(false, |
| 44 "you have to use pen for this test"); |
| 45 }, "you have to use pen for this test"); |
| 46 } |
| 47 }); |
| 48 } |
| 49 |
| 50 </script> |
| 51 <h1>Pointer Events pointerout tests</h1> |
| 52 <div id="complete-notice"> |
| 53 <p>The following pointer types were detected: <span id="pointertype-
log"></span>.</p> |
| 54 </div> |
| 55 <div id="log"></div> |
| 56 </body> |
| 57 </html> |
OLD | NEW |