Index: LayoutTests/pointer-lock/bug90391-move-then-window-open-crash-prefixed.html |
diff --git a/LayoutTests/pointer-lock/bug90391-move-then-window-open-crash-prefixed.html b/LayoutTests/pointer-lock/bug90391-move-then-window-open-crash-prefixed.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a092e7d4a3c27b3922b1fdfd7d571c958d3bc992 |
--- /dev/null |
+++ b/LayoutTests/pointer-lock/bug90391-move-then-window-open-crash-prefixed.html |
@@ -0,0 +1,53 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<head> |
+<script src="../resources/js-test.js"></script> |
+<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness-prefixed.js"></script> |
+</head> |
+<body> |
+<div> |
+ <div id="target1"></div> |
+</div> |
+<script> |
+ description("bug 90391: pointer lock mouse move events then window.open should not crash.") |
+ window.jsTestIsAsync = true; |
+ |
+ targetdiv1 = document.getElementById("target1"); |
+ |
+ todo = [ |
+ function () { |
+ debug(" Locking targetdiv1.") |
+ targetdiv1.webkitRequestPointerLock(); |
+ document.onwebkitpointerlockchange = function () { |
+ document.onwebkitpointerlockchange = null; |
+ testPassed("document.onwebkitpointerlockchange event received."); |
+ doNextStep(); |
+ }; |
+ }, |
+ function () { |
+ debug(" Sending mouse move events.") |
+ var mouseMoveEvents = 0; |
+ targetdiv1.onmousemove = function () { |
+ if (++mouseMoveEvents == 2) { |
+ targetdiv1.onmousemove = null; |
+ doNextStep(); |
+ } |
+ } |
+ if (window.eventSender) { |
+ eventSender.mouseMoveTo(100, 100); |
+ eventSender.mouseMoveTo(200, 200); |
+ } |
+ }, |
+ function () { |
+ debug(" Calling window.open.") |
+ gc(); |
+ window.open(); |
+ testPassed("Didn't crash"); |
+ document.webkitExitPointerLock(); |
+ doNextStep(); |
+ }, |
+ ]; |
+ doNextStepWithUserGesture(); |
+</script> |
+</body> |
+</html> |