mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 1612821 - Remove pointerevent_pointerlock_after_pointercapture-manual.html test; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D69984 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
36fd49aa19
commit
eef74ae73a
@ -9,6 +9,4 @@ support-files =
|
||||
support-files =
|
||||
pointerevent_movementxy-manual.html
|
||||
./resources/pointerevent_movementxy-iframe.html
|
||||
[test_pointerevent_pointerlock_after_pointercapture-manual.html]
|
||||
support-files = pointerevent_pointerlock_after_pointercapture-manual.html
|
||||
disabled = bug 1612821 # We don't allow pointer lock in mousemove handlers.
|
||||
|
||||
|
@ -1,69 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Pointer Events pointer lock test</title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="../pointerevent_support.js"></script>
|
||||
<script>
|
||||
var got_capture = false;
|
||||
var lost_capture = false;
|
||||
var lock_requested = false;
|
||||
|
||||
function resetTestState() {
|
||||
}
|
||||
|
||||
function run() {
|
||||
var test_pointerEvent = setup_pointerevent_test("no pointercapture while pointerlock", ['mouse']);
|
||||
var div1 = document.getElementById("div1");
|
||||
var div2 = document.getElementById("div2");
|
||||
|
||||
on_event(div1, 'pointerdown', function(event) {
|
||||
div2.setPointerCapture(event.pointerId);
|
||||
});
|
||||
on_event(div1, 'pointermove', function(event) {
|
||||
if (lost_capture) {
|
||||
test_pointerEvent.step(function() {
|
||||
assert_equals(document.pointerLockElement, div1, "document.pointerLockElement should be div1.");
|
||||
assert_true(lost_capture, "Pointer capture was lost after got a pointer lock.");
|
||||
});
|
||||
test_pointerEvent.done();
|
||||
}
|
||||
});
|
||||
on_event(div2, 'pointermove', function(event) {
|
||||
if (got_capture && !lock_requested) {
|
||||
div1.requestPointerLock();
|
||||
lock_requested = true;
|
||||
}
|
||||
});
|
||||
on_event(div2, 'gotpointercapture', function(event) {
|
||||
got_capture = true;
|
||||
});
|
||||
on_event(div2, 'lostpointercapture', function(event) {
|
||||
lost_capture = true;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
<h1>Pointer Events pointer lock test</h1>
|
||||
<h2 id="pointerTypeDescription"></h2>
|
||||
<h4>
|
||||
Test Description: This test checks that we release the exsiting pointer capture when any element in the page gets a pointer lock.
|
||||
<ol>
|
||||
<li>Press left button down on the green rectangle and hold it.</li>
|
||||
<li>Move the mouse inside the green rectangle.</li>
|
||||
</ol>
|
||||
|
||||
Test passes if the pointer capture is released on the yellow rectangle when the green rectangle gets the pointer lock.
|
||||
</h4>
|
||||
<div id="testContainer">
|
||||
<div id="div1" style="width:800px;height:250px;background:green"></div>
|
||||
<div id="div2" style="width:800px;height:250px;background:yellow"></div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,35 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1399740
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1399740</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="text/javascript" src="mochitest_support_external.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
function startTest() {
|
||||
runTestInNewWindow("pointerevent_pointerlock_after_pointercapture-manual.html");
|
||||
}
|
||||
function executeTest(int_win) {
|
||||
int_win.document.addEventListener("gotpointercapture", () => {
|
||||
int_win.document.addEventListener("pointerlockchange", () => {
|
||||
sendMouseEvent(int_win, "div1", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
sendMouseEvent(int_win, "div1", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
sendMouseEvent(int_win, "div1", "mouseup", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
}, { once: true });
|
||||
sendMouseEvent(int_win, "div1", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
sendMouseEvent(int_win, "div1", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
}, { once: true });
|
||||
sendMouseEvent(int_win, "div1", "mousedown", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
sendMouseEvent(int_win, "div1", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_MOUSE});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user