Bug 1621830 - Remove test_pointerevent_element_haspointercapture-manual.html; r=smaug

Depends on D66561

Differential Revision: https://phabricator.services.mozilla.com/D66562

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edgar Chen 2020-03-12 14:52:12 +00:00
Родитель cbe66c6e97
Коммит cf26fb4712
3 изменённых файлов: 0 добавлений и 161 удалений

Просмотреть файл

@ -42,8 +42,6 @@ support-files = pointerevent_change-touch-action-onpointerdown_touch-manual.html
disabled = disabled
[test_pointerevent_constructor.html]
support-files = pointerevent_constructor.html
[test_pointerevent_element_haspointercapture-manual.html]
support-files = pointerevent_element_haspointercapture-manual.html
[test_pointerevent_element_haspointercapture_release_pending_capture-manual.html]
support-files = pointerevent_element_haspointercapture_release_pending_capture-manual.html
[test_pointerevent_lostpointercapture_for_disconnected_node-manual.html]

Просмотреть файл

@ -1,127 +0,0 @@
<!doctype html>
<html>
<head>
<title>Element.hasPointerCapture 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>
<script type="text/javascript" src="pointerevent_support.js"></script>
<script>
var detected_pointertypes = {};
add_completion_callback(showPointerTypes);
var test_pointerEvent = async_test("hasPointerCapture");
var listening_events = [
"pointerover",
"pointerenter",
"pointerout",
"pointerleave",
"pointermove",
"gotpointercapture"
];
var set_capture_to_target0 = false;
function run() {
var target0 = document.getElementById("target0");
var target1 = document.getElementById("target1");
on_event(target0, "pointerdown", function (e) {
detected_pointertypes[e.pointerType] = true;
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"before target0.setPointerCapture, target0.hasPointerCapture should be false");
});
target1.setPointerCapture(e.pointerId);
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"after target1.setPointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), true,
"after target1.setPointerCapture, target1.hasPointerCapture should be true");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
// hasPointerCapture will return true immediately after a call to setPointerCapture
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), true,
"after target0.setPointerCapture, target0.hasPointerCapture should be true");
});
// hasPointerCapture will return false immediately after a call to releasePointerCapture
target0.releasePointerCapture(e.pointerId);
set_capture_to_target0 = false;
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target1.hasPointerCapture should be false");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), true,
"after target0.setPointerCapture, target0.hasPointerCapture should be true");
});
// If the element.hasPointerCapture is false element.releasePointerCapture does nothing
target1.releasePointerCapture(e.pointerId);
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), true,
"while target1.hasPointerCapture is false, target1.releasePointerCapture should not change hasPointerCapture");
});
});
for (var i = 0; i < listening_events.length; i++) {
on_event(target0, listening_events[i], function (e) {
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), set_capture_to_target0,
"Received " + e.type + " target0.hasPointerCapture should be " + set_capture_to_target0);
});
});
}
on_event(target0, "pointerup", function (e) {
// Immediately after firing the pointerup or pointercancel events, a user agent must clear
// the pending pointer capture target override for the pointerId, and then run
// "Process Pending Pointer Capture" steps to fire lostpointercapture if necessary.
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), true,
"pointerup target0.hasPointerCapture should be true");
});
set_capture_to_target0 = false;
});
on_event(target0, "lostpointercapture", function (e) {
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"pointerup target0.hasPointerCapture should be false");
});
});
on_event(target1, "pointerup", function (e) {
test_pointerEvent.step(function () {
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"pointerup target1.hasPointerCapture should be false");
});
test_pointerEvent.done();
});
}
</script>
</head>
<body onload="run()">
<h1>Element.hasPointerCapture test</h1>
<h4>
Test Description: This test checks if Element.hasPointerCapture returns value correctly
<ol>
<li> Press black rectangle and do not release
<li> Move your pointer to purple rectangle
<li> Release the pointer
<li> Click purple rectangle
</ol>
</h4>
<p>
<div id="target0" touch-action:none></div>
<div id="target1" touch-action:none></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

Просмотреть файл

@ -1,32 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1000870</title>
<meta name="author" content="Maksim Lebedev" />
<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_element_haspointercapture-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousemove");
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mousemove");
sendMouseEvent(int_win, "target1", "mousemove");
sendMouseEvent(int_win, "target1", "mouseup");
sendMouseEvent(int_win, "target1", "mousedown");
sendMouseEvent(int_win, "target1", "mouseup");
}
</script>
</head>
<body>
</body>
</html>