OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness-pref
ixed.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <div> |
| 9 <div id="target1"></div> |
| 10 </div> |
| 11 <script> |
| 12 description("bug 90391: pointer lock mouse move events then window.open shou
ld not crash.") |
| 13 window.jsTestIsAsync = true; |
| 14 |
| 15 targetdiv1 = document.getElementById("target1"); |
| 16 |
| 17 todo = [ |
| 18 function () { |
| 19 debug(" Locking targetdiv1.") |
| 20 targetdiv1.webkitRequestPointerLock(); |
| 21 document.onwebkitpointerlockchange = function () { |
| 22 document.onwebkitpointerlockchange = null; |
| 23 testPassed("document.onwebkitpointerlockchange event received.")
; |
| 24 doNextStep(); |
| 25 }; |
| 26 }, |
| 27 function () { |
| 28 debug(" Sending mouse move events.") |
| 29 var mouseMoveEvents = 0; |
| 30 targetdiv1.onmousemove = function () { |
| 31 if (++mouseMoveEvents == 2) { |
| 32 targetdiv1.onmousemove = null; |
| 33 doNextStep(); |
| 34 } |
| 35 } |
| 36 if (window.eventSender) { |
| 37 eventSender.mouseMoveTo(100, 100); |
| 38 eventSender.mouseMoveTo(200, 200); |
| 39 } |
| 40 }, |
| 41 function () { |
| 42 debug(" Calling window.open.") |
| 43 gc(); |
| 44 window.open(); |
| 45 testPassed("Didn't crash"); |
| 46 document.webkitExitPointerLock(); |
| 47 doNextStep(); |
| 48 }, |
| 49 ]; |
| 50 doNextStepWithUserGesture(); |
| 51 </script> |
| 52 </body> |
| 53 </html> |
OLD | NEW |