Commit 02efc0f4 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Revert "Re-write test pointerevent_pointermove_in_pointerlock.html"

This reverts commit 9b7bafff.

Reason for revert: Causing leak failures on WebKit Linux Leak bot

https://luci-milo.appspot.com/p/chromium/builders/ci/WebKit%20Linux%20Leak/2348

Original change's description:
> Re-write test pointerevent_pointermove_in_pointerlock.html
> 
> The test was failing in wpt because it passing non-integer value to
> test driver. This CL changes it to use "origin" instead.
> This CL rewrites the test to makes it cleaner, instead of adding event
> listener inside event listener.
> This CL also changes the test to send the "move" events after receiving
> pointerlockchange.
> 
> Bug: 986277
> Change-Id: I0f51523c3c90791339877b2e51afa8e9a4cc9d4d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717195
> Reviewed-by: Lan Wei <lanwei@chromium.org>
> Commit-Queue: Ella Ge <eirage@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#680563}

TBR=lanwei@chromium.org,eirage@chromium.org

Change-Id: Ia53d1066363ceaf804f61ada369a4126c859f875
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 986277
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716038Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680743}
parent 0ae651fc
......@@ -34,58 +34,54 @@
var target1 = innerframe.contentDocument.getElementById('target1');
innerframe.contentWindow.name = "innerframe";
on_event(target0, "click", function(event) {
target0.requestPointerLock();
});
on_event(target1, "click", function(event) {
target1.requestPointerLock();
});
on_event(target0, "pointermove", function (event) {
on_event(document, "pointerlockchange", function(event) {
if (document.pointerLockElement == target0) {
test_pointermove.step(function() {
assert_equals(event.view.name, "outerframe", "View attribute of pointermove should be the target frame.");
}, "View attribute of pointermove should be the target frame.");
document.exitPointerLock();
// Click the inner frame target to lock.
clickInTarget("mouse", target1);
}
});
on_event(target0, "pointermove", function (event) {
test_pointermove.step(function() {
assert_equals(event.view.name, "outerframe", "View attribute of pointermove should be the target frame.");
}, "View attribute of pointermove should be the target frame.");
document.exitPointerLock();
on_event(target1, "pointermove", function (event) {
if (innerframe.contentDocument.pointerLockElement == target1) {
test_pointermove.step(function() {
assert_equals(event.view.name, "innerframe", "View attribute of pointermove should be the target frame.");
}, "View attribute of pointermove should be the target frame.");
innerframe.contentDocument.exitPointerLock();
test_pointermove.done();
}
});
on_event(target1, "click", function(event) {
target1.requestPointerLock();
});
on_event(document, "pointerlockchange", function(event) {
if (document.pointerLockElement == target0) {
// Send moves in main frame target
new test_driver.Actions()
.pointerMove(10, 30, {origin: target0})
.pointerMove(20, 10, {origin: target0})
.send();
on_event(innerframe.contentDocument, "pointerlockchange", function(event) {
if (innerframe.contentDocument.pointerLockElement == target1) {
on_event(target1, "pointermove", function (event) {
innerframe_pointermoveReceived = true;
test_pointermove.step(function() {
assert_equals(event.view.name, "innerframe", "View attribute of pointermove should be the target frame.");
}, "View attribute of pointermove should be the target frame.");
innerframe.contentDocument.exitPointerLock();
test_pointermove.done();
});
}
});
});
}
});
on_event(innerframe.contentDocument, "pointerlockchange", function(event) {
if (innerframe.contentDocument.pointerLockElement == target1) {
// Send moves in inner frame target
new test_driver.Actions()
.pointerMove(10, 30, {origin: target1})
.pointerMove(20, 10, {origin: target1})
.send();
}
on_event(target0, "click", function(event) {
target0.requestPointerLock();
});
// Click the outer frame target to lock.
clickInTarget("mouse", target0);
var x = innerframe.getBoundingClientRect().x + target1.getBoundingClientRect().x;
var y = innerframe.getBoundingClientRect().y + target1.getBoundingClientRect().y;
// Inject mouse input
new test_driver.Actions()
.pointerMove(5, 5, {origin: target0})
.pointerDown()
.pointerUp()
.pointerMove(100, 300, {origin: target0})
.pointerMove(x+10, y+10)
.pointerDown()
.pointerUp()
.pointerMove(5, 5, {origin: target0})
.send();
}
</script>
<div id="complete-notice">
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment