helper_bug1414336.html (2968B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1414336 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1414336</title> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <script type="text/javascript" src="apz_test_native_event_utils.js"></script> 11 <script type="text/javascript" src="apz_test_utils.js"></script> 12 <script src="/tests/SimpleTest/paint_listener.js"></script> 13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 14 <style> 15 #target0 { 16 width: 200px; 17 height: 400px; 18 touch-action: auto; 19 } 20 </style> 21 </head> 22 <body> 23 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414336">Mozilla Bug 1414336</a> 24 <p id="display"></p> 25 <div id="target0"> 26 <p>Test bug1414336</p> 27 <p>Test bug1414336</p> 28 <p>Test bug1414336</p> 29 <p>Test bug1414336</p> 30 <p>Test bug1414336</p> 31 <p>Test bug1414336</p> 32 <p>Test bug1414336</p> 33 <p>Test bug1414336</p> 34 <p>Test bug1414336</p> 35 <p>Test bug1414336</p> 36 <p>Test bug1414336</p> 37 <p>Test bug1414336</p> 38 <p>Test bug1414336</p> 39 <p>Test bug1414336</p> 40 <p>Test bug1414336</p> 41 <p>Test bug1414336</p> 42 <p>Test bug1414336</p> 43 <p>Test bug1414336</p> 44 <p>Test bug1414336</p> 45 <p>Test bug1414336</p> 46 <p>Test bug1414336</p> 47 <p>Test bug1414336</p> 48 <p>Test bug1414336</p> 49 <p>Test bug1414336</p> 50 <p>Test bug1414336</p> 51 <p>Test bug1414336</p> 52 <p>Test bug1414336</p> 53 <p>Test bug1414336</p> 54 <p>Test bug1414336</p> 55 <p>Test bug1414336</p> 56 <p>Test bug1414336</p> 57 <p>Test bug1414336</p> 58 </div> 59 <script type="text/javascript"> 60 /** Test for Bug 1414336 */ 61 waitUntilApzStable().then(async () => { 62 let target0 = window.document.getElementById("target0"); 63 let target0_events = ["pointerdown", "pointermove"]; 64 65 target0_events.forEach((elem) => { 66 target0.addEventListener(elem, (event) => { 67 is(event.type, target0_events[0], "receive " + event.type + " on target0"); 68 target0_events.shift(); 69 }, { once: true }); 70 }); 71 72 target0.addEventListener("pointercancel", () => { 73 ok(false, "Shouldn't receive pointercancel when content prevents default on touchstart"); 74 // Wait until the event is done processing before we end the subtest, 75 // otherwise on Android the pointer events pref is flipped back to false 76 // and debug builds will assert. 77 setTimeout(subtestDone, 0); 78 }, { once: true }); 79 80 target0.addEventListener("touchstart", (event) => { 81 event.preventDefault(); 82 }, { once: true }); 83 84 target0.addEventListener("pointerup", () => { 85 ok(!target0_events.length, " should receive " + target0_events + " on target0"); 86 // Wait until the event is done processing before we end the subtest, 87 // otherwise on Android the pointer events pref is flipped back to false 88 // and debug builds will assert. 89 setTimeout(subtestDone, 0); 90 }, { once: true }); 91 92 await synthesizeNativeTouchDrag(target0, 2, 2, 0, 80); 93 }); 94 95 </script> 96 </body> 97 </html>