Bug 1322994 - Update pointerevent web-platform-tests. r=smaug

MozReview-Commit-ID: CFnBxbCaVVk

--HG--
rename : dom/events/test/pointerevents/pointerevent_pointermove-on-chorded-mouse-button.html => dom/events/test/pointerevents/pointerevent_pointermove_on_chorded_mouse_button-manual.html
rename : dom/events/test/pointerevents/pointerevent_suppress_compat_events_on_click.html => dom/events/test/pointerevents/pointerevent_suppress_compat_events_on_click-manual.html
rename : dom/events/test/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html => dom/events/test/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse-manual.html
rename : dom/events/test/pointerevents/test_pointerevent_pointermove-on-chorded-mouse-button.html => dom/events/test/pointerevents/test_pointerevent_pointermove_on_chorded_mouse_button-manual.html
rename : dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_click.html => dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_click-manual.html
rename : dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_drag_mouse.html => dom/events/test/pointerevents/test_pointerevent_suppress_compat_events_on_drag_mouse-manual.html
extra : rebase_source : 47e428039914001c64194ab28510f113e7e6dba4
extra : histedit_source : 225f1675260b86f4dd5daa7ed272f6071672e543
This commit is contained in:
Stone Shih 2016-12-12 11:21:29 +08:00
parent e4bb5f373c
commit 805b755bb1
65 changed files with 620 additions and 1713 deletions

View File

@ -6,12 +6,20 @@ support-files =
pointerevent_styles.css
pointerevent_support.js
[test_pointerevent_attributes_mouse-manual.html]
support-files = pointerevent_attributes_mouse-manual.html
[test_pointerevent_attributes_hoverable_pointers-manual.html]
support-files =
pointerevent_attributes_hoverable_pointers-manual.html
./resources/pointerevent_attributes_hoverable_pointers-iframe.html
[test_pointerevent_attributes_nohover_pointers-manual.html]
support-files =
pointerevent_attributes_nohover_pointers-manual.html
./resources/pointerevent_attributes_hoverable_pointers-iframe.html
disabled = should be investigated
[test_pointerevent_capture_mouse-manual.html]
support-files = pointerevent_capture_mouse-manual.html
[test_pointerevent_capture_suppressing_mouse-manual.html]
support-files = pointerevent_capture_suppressing_mouse-manual.html
disabled = should be investigated
[test_pointerevent_change-touch-action-onpointerdown_touch-manual.html]
support-files = pointerevent_change-touch-action-onpointerdown_touch-manual.html
disabled = disabled
@ -32,67 +40,35 @@ support-files =
disabled = should be investigated
[test_pointerevent_pointercancel_touch-manual.html]
support-files = pointerevent_pointercancel_touch-manual.html
[test_pointerevent_pointerdown-manual.html]
support-files = pointerevent_pointerdown-manual.html
[test_pointerevent_pointerenter_does_not_bubble-manual.html]
support-files = pointerevent_pointerenter_does_not_bubble-manual.html
[test_pointerevent_pointerenter_nohover-manual.html]
support-files = pointerevent_pointerenter_nohover-manual.html
[test_pointerevent_pointerId_scope-manual.html]
support-files =
test_pointerevent_pointerId_scope-manual.html
./resources/pointerevent_pointerId_scope-iframe.html
disabled = should be investigated
[test_pointerevent_pointerenter-manual.html]
support-files = pointerevent_pointerenter-manual.html
[test_pointerevent_pointerleave_after_pointercancel_touch-manual.html]
support-files = pointerevent_pointerleave_after_pointercancel_touch-manual.html
[test_pointerevent_pointerleave_after_pointerup_nohover-manual.html]
support-files = pointerevent_pointerleave_after_pointerup_nohover-manual.html
[test_pointerevent_pointerleave_descendant_over-manual.html]
support-files = pointerevent_pointerleave_descendant_over-manual.html
[test_pointerevent_pointerleave_descendants-manual.html]
support-files = pointerevent_pointerleave_descendants-manual.html
[test_pointerevent_pointerleave_does_not_bubble-manual.html]
support-files = pointerevent_pointerleave_does_not_bubble-manual.html
[test_pointerevent_pointerleave_mouse-manual.html]
support-files = pointerevent_pointerleave_mouse-manual.html
[test_pointerevent_pointerleave_pen-manual.html]
support-files = pointerevent_pointerleave_pen-manual.html
[test_pointerevent_pointerleave_touch-manual.html]
support-files = pointerevent_pointerleave_touch-manual.html
[test_pointerevent_pointermove-manual.html]
support-files = pointerevent_pointermove-manual.html
[test_pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html]
support-files = pointerevent_pointermove_isprimary_same_as_pointerdown-manual.html
[test_pointerevent_pointermove-on-chorded-mouse-button.html]
support-files = pointerevent_pointermove-on-chorded-mouse-button.html
[test_pointerevent_pointermove_pointertype-manual.html]
support-files = pointerevent_pointermove_pointertype-manual.html
[test_pointerevent_pointerout-manual.html]
support-files = pointerevent_pointerout-manual.html
[test_pointerevent_pointermove_on_chorded_mouse_button-manual.html]
support-files = pointerevent_pointermove_on_chorded_mouse_button-manual.html
[test_pointerevent_pointerout_after_pointercancel_touch-manual.html]
support-files = pointerevent_pointerout_after_pointercancel_touch-manual.html
[test_pointerevent_pointerout_after_pointerup_nohover-manual.html]
support-files = pointerevent_pointerout_after_pointerup_nohover-manual.html
[test_pointerevent_pointerout_pen-manual.html]
support-files = pointerevent_pointerout_pen-manual.html
[test_pointerevent_pointerout_received_once-manual.html]
support-files = pointerevent_pointerout_received_once-manual.html
[test_pointerevent_pointerover-manual.html]
support-files = pointerevent_pointerover-manual.html
[test_pointerevent_pointertype_mouse-manual.html]
support-files = pointerevent_pointertype_mouse-manual.html
[test_pointerevent_pointertype_pen-manual.html]
support-files = pointerevent_pointertype_pen-manual.html
[test_pointerevent_pointertype_touch-manual.html]
support-files = pointerevent_pointertype_touch-manual.html
[test_pointerevent_pointerup-manual.html]
support-files = pointerevent_pointerup-manual.html
[test_pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html]
support-files = pointerevent_pointerup_isprimary_same_as_pointerdown-manual.html
[test_pointerevent_pointerup_pointertype-manual.html]
support-files = pointerevent_pointerup_pointertype-manual.html
[test_pointerevent_releasepointercapture_events_to_original_target-manual.html]
support-files = pointerevent_releasepointercapture_events_to_original_target-manual.html
[test_pointerevent_releasepointercapture_invalid_pointerid-manual.html]
@ -116,10 +92,10 @@ support-files =
support-files = pointerevent_setpointercapture_relatedtarget-manual.html
[test_pointerevent_setpointercapture_to_same_element_twice-manual.html]
support-files = pointerevent_setpointercapture_to_same_element_twice-manual.html
[test_pointerevent_suppress_compat_events_on_click.html]
support-files = pointerevent_suppress_compat_events_on_click.html
[test_pointerevent_suppress_compat_events_on_drag_mouse.html]
support-files = pointerevent_suppress_compat_events_on_drag_mouse.html
[test_pointerevent_suppress_compat_events_on_click-manual.html]
support-files = pointerevent_suppress_compat_events_on_click-manual.html
[test_pointerevent_suppress_compat_events_on_drag_mouse-manual.html]
support-files = pointerevent_suppress_compat_events_on_drag_mouse-manual.html
[test_touch_action.html]
support-files =
../../../../gfx/layers/apz/test/mochitest/apz_test_utils.js

View File

@ -0,0 +1,144 @@
<!doctype html>
<html>
<head>
<title>Pointer Events properties tests</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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script>
var detected_pointertypes = {};
var detected_eventTypes = {};
var eventList = ['pointerover', 'pointerenter', 'pointermove', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
var expectedPointerId = NaN;
function resetTestState() {
detected_eventTypes = {};
document.getElementById("square1").style.visibility = 'visible';
document.getElementById('innerFrame').contentDocument.getElementById("square2").style.visibility = 'hidden';
expectedPointerId = NaN;
}
function checkPointerEventAttributes(event, targetBoundingClientRect, testNamePrefix) {
if (detected_eventTypes[event.type])
return;
var expectedEventType = eventList[Object.keys(detected_eventTypes).length];
detected_eventTypes[event.type] = true;
var pointerTestName = testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType;
detected_pointertypes[event.pointerType] = true;
test(function() {
assert_equals(event.type, expectedEventType, "Event.type should be " + expectedEventType)
}, pointerTestName + "'s type should be " + expectedEventType);
// Test button and buttons
if (event.type == 'pointerdown') {
test(function() {
assert_true(event.button == 0, "Button attribute is 0")
}, pointerTestName + "'s button attribute is 0 when left mouse button is pressed.");
test(function() {
assert_true(event.buttons == 1, "Buttons attribute is 1")
}, pointerTestName + "'s buttons attribute is 1 when left mouse button is pressed.");
} else if (event.type == 'pointerup') {
test(function() {
assert_true(event.button == 0, "Button attribute is 0")
}, pointerTestName + "'s button attribute is 0 when left mouse button is just released.");
test(function() {
assert_true(event.buttons == 0, "Buttons attribute is 0")
}, pointerTestName + "'s buttons attribute is 0 when left mouse button is just released.");
} else {
test(function() {
assert_true(event.button == -1, "Button attribute is -1")
}, pointerTestName + "'s button is -1 when mouse buttons are in released state.");
test(function() {
assert_true(event.buttons == 0, "Buttons attribute is 0")
}, pointerTestName + "'s buttons is 0 when mouse buttons are in released state.");
}
// Test clientX and clientY
if (event.type != 'pointerout' && event.type != 'pointerleave' ) {
test(function () {
assert_true(event.clientX >= targetBoundingClientRect.left && event.clientX < targetBoundingClientRect.right && event.clientY >= targetBoundingClientRect.top && event.clientY < targetBoundingClientRect.bottom, "ClientX/Y should be in the boundaries of the box");
}, pointerTestName + "'s ClientX and ClientY attributes are correct.");
} else {
test(function () {
assert_true(event.clientX < targetBoundingClientRect.left || event.clientX > targetBoundingClientRect.right - 1 || event.clientY < targetBoundingClientRect.top || event.clientY > targetBoundingClientRect.bottom - 1, "ClientX/Y should be out of the boundaries of the box");
}, pointerTestName + "'s ClientX and ClientY attributes are correct.");
}
check_PointerEvent(event, testNamePrefix);
// Test isPrimary value
test(function () {
assert_equals(event.isPrimary, true, "isPrimary should be true");
}, pointerTestName + ".isPrimary attribute is correct.");
// Test pointerId value
if (isNaN(expectedPointerId)) {
expectedPointerId = event.pointerId;
} else {
test(function () {
assert_equals(event.pointerId, expectedPointerId, "pointerId should remain the same for the same active pointer");
}, pointerTestName + ".pointerId should be the same as previous pointer events for this active pointer.");
}
}
function run() {
var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", HOVERABLE_POINTERS);
var square1 = document.getElementById("square1");
var rectSquare1 = square1.getBoundingClientRect();
var innerFrame = document.getElementById('innerFrame');
var square2 = innerFrame.contentDocument.getElementById('square2');
var rectSquare2 = square2.getBoundingClientRect();
eventList.forEach(function(eventName) {
on_event(square1, eventName, function (event) {
if (square1.style.visibility == 'hidden')
return;
checkPointerEventAttributes(event, rectSquare1, "");
if (Object.keys(detected_eventTypes).length == eventList.length) {
square1.style.visibility = 'hidden';
detected_eventTypes = {};
square2.style.visibility = 'visible';
expectedPointerId = NaN;
}
});
on_event(square2, eventName, function (event) {
checkPointerEventAttributes(event, rectSquare2, "Inner frame ");
if (Object.keys(detected_eventTypes).length == eventList.length) {
square2.style.visibility = 'hidden';
test_pointerEvent.done();
}
});
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Events hoverable pointer attributes test</h1>
<h2 id="pointerTypeDescription"></h2>
<h4>
Test Description: This test checks the properties of hoverable pointer events. If you are using hoverable pen don't leave the range of digitizer while doing the instructions.
<ol>
<li>Move your pointer over the black square and click on it.</li>
<li>Then move it off the black square so that it disappears.</li>
<li>When red square appears move your pointer over the red square and click on it.</li>
<li>Then move it off the red square.</li>
</ol>
Test passes if the proper behavior of the events is observed.
</h4>
<div id="square1" class="square"></div>
<iframe id="innerFrame" src="resources/pointerevent_attributes_hoverable_pointers-iframe.html"></iframe>
<div class="spacer"></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,113 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Events properties tests</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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script>
var detected_pointertypes = {};
var detected_eventTypes = {};
var test_pointerEvent = async_test("pointerevent attributes");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var square1 = document.getElementById("square1");
var rectSquare1 = square1.getBoundingClientRect();
var pointerover_event;
var eventList = ['pointerenter', 'pointerover', 'pointermove', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
eventList.forEach(function(eventName) {
on_event(square1, eventName, function (event) {
if (detected_eventTypes[event.type])
return;
detected_pointertypes[event.pointerType] = true;
test(function () {
assert_equals(event.pointerType, 'mouse', 'pointerType should be mouse');
}, event.type + ".pointerType attribute is correct.");
// Test button and buttons
if (event.type == 'pointerdown') {
test(function() {
assert_true(event.button == 0, "If left mouse button is pressed button attribute is 0")
}, event.type + "'s button attribute is 0 when left mouse button is pressed.");
test(function() {
assert_true(event.buttons == 1, "If left mouse button is pressed buttons attribute is 1")
}, event.type + "'s buttons attribute is 1 when left mouse button is pressed.");
} else if (event.type == 'pointerup') {
test(function() {
assert_true(event.button == 0, "If left mouse button is just released button attribute is 0")
}, event.type + "'s button attribute is 0 when left mouse button is just released.");
test(function() {
assert_true(event.buttons == 0, "If left mouse button is just released buttons attribute is 0")
}, event.type + "'s buttons attribute is 0 when left mouse button is just released.");
} else {
test(function() {
assert_true(event.button == -1, "If mouse buttons are released button attribute is -1")
}, event.type + "'s button is -1 when mouse buttons are released.");
test(function() {
assert_true(event.buttons == 0, "If mouse buttons are released buttons attribute is 0")
}, event.type + "'s buttons is 0 when mouse buttons are released.");
}
// Test clientX and clientY
if (event.type != 'pointerout' && event.type != 'pointerleave' ) {
test(function () {
assert_true(event.clientX >= rectSquare1.left && event.clientX < rectSquare1.right, "ClientX should be in the boundaries of the black box");
}, event.type + ".clientX attribute is correct.");
test(function () {
assert_true(event.clientY >= rectSquare1.top && event.clientY < rectSquare1.bottom, "ClientY should be in the boundaries of the black box");
}, event.type + ".clientY attribute is correct.");
} else {
test(function () {
assert_true(event.clientX < rectSquare1.left || event.clientX > rectSquare1.right - 1 || event.clientY < rectSquare1.top || event.clientY > rectSquare1.bottom - 1, "ClientX/Y should be out of the boundaries of the black box");
}, event.type + "'s ClientX and ClientY attributes are correct.");
}
// Test isPrimary
test(function () {
assert_equals(event.isPrimary, true, "isPrimary should be true");
}, event.type + ".isPrimary attribute is correct.");
// Test width and height
test(function () {
assert_equals(event.width, 1, "width of mouse should be 1");
}, event.type + ".width attribute is correct.");
test(function () {
assert_equals(event.height, 1, "height of mouse should be 1");
}, event.type + ".height attribute is correct.");
check_PointerEvent(event);
detected_eventTypes[event.type] = true;
if (Object.keys(detected_eventTypes).length == eventList.length)
test_pointerEvent.done();
});
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Events pointerdown tests</h1>
<!--
<h4>
Test Description: This test checks the properties of mouse pointer events. Move your mouse over the black square and click on it. Then move it off the black square.
</h4>
-->
Test passes if the proper behavior of the events is observed.
<div id="square1" class="square"></div>
<div class="spacer"></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -0,0 +1,127 @@
<!doctype html>
<html>
<head>
<title>Pointer Events properties tests</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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script>
var detected_pointertypes = {};
var detected_eventTypes = {};
var eventList = ['pointerover', 'pointerenter', 'pointerdown', 'pointerup', 'pointerout', 'pointerleave'];
var expectedPointerId = NaN;
function resetTestState() {
detected_eventTypes = {};
document.getElementById("square1").style.visibility = 'visible';
document.getElementById('innerFrame').contentDocument.getElementById("square2").style.visibility = 'hidden';
}
function checkPointerEventAttributes(event, targetBoundingClientRect, testNamePrefix) {
if (detected_eventTypes[event.type])
return;
var expectedEventType = eventList[Object.keys(detected_eventTypes).length];
detected_eventTypes[event.type] = true;
var pointerTestName = testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType;
detected_pointertypes[event.pointerType] = true;
test(function() {
assert_equals(event.type, expectedEventType, "Event.type should be " + expectedEventType)
}, pointerTestName + "'s type should be " + expectedEventType);
// Test button and buttons
test(function() {
assert_true(event.button == 0, "Button attribute is 0")
}, pointerTestName + "'s button attribute is 0 when left mouse button is pressed.");
if (event.type == 'pointerdown' || event.type == 'pointerover' || event.type == 'pointerenter') {
test(function() {
assert_true(event.buttons == 1, "Buttons attribute is 1")
}, pointerTestName + "'s buttons attribute is 1 when left mouse button is pressed.");
} else {
test(function() {
assert_true(event.buttons == 0, "Buttons attribute is 0")
}, pointerTestName + "'s buttons is 0 when mouse buttons are in released state.");
}
// Test clientX and clientY
test(function () {
assert_true(event.clientX >= targetBoundingClientRect.left && event.clientX < targetBoundingClientRect.right && event.clientY >= targetBoundingClientRect.top && event.clientY < targetBoundingClientRect.bottom, "ClientX/Y should be in the boundaries of the box");
}, pointerTestName + "'s ClientX and ClientY attributes are correct.");
check_PointerEvent(event, testNamePrefix);
// Test isPrimary
test(function () {
assert_equals(event.isPrimary, true, "isPrimary should be true");
}, pointerTestName + ".isPrimary attribute is correct.");
// Test pointerId value
if (isNaN(expectedPointerId)) {
expectedPointerId = event.pointerId;
} else {
test(function () {
assert_equals(event.pointerId, expectedPointerId, "pointerId should remain the same for the same active pointer");
}, pointerTestName + ".pointerId should be the same as previous pointer events for this active pointer.");
}
}
function run() {
var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", NOHOVER_POINTERS);
var square1 = document.getElementById("square1");
var rectSquare1 = square1.getBoundingClientRect();
var innerFrame = document.getElementById('innerFrame');
var square2 = innerFrame.contentDocument.getElementById('square2');
var rectSquare2 = square2.getBoundingClientRect();
eventList.forEach(function(eventName) {
on_event(square1, eventName, function (event) {
if (square1.style.visibility == 'hidden')
return;
checkPointerEventAttributes(event, rectSquare1, "");
if (Object.keys(detected_eventTypes).length == eventList.length) {
square1.style.visibility = 'hidden';
detected_eventTypes = {};
square2.style.visibility = 'visible';
expectedPointerId = NaN;
}
});
on_event(square2, eventName, function (event) {
checkPointerEventAttributes(event, rectSquare2, "Inner frame ");
if (Object.keys(detected_eventTypes).length == eventList.length) {
square2.style.visibility = 'hidden';
test_pointerEvent.done();
}
});
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Events no-hover pointer attributes test</h1>
<h2 id="pointerTypeDescription"></h2>
<h4>
Test Description: This test checks the properties of pointer events that do not support hover.
<ol>
<li>Tap the black square.</li>
<li>Then move it off the black square so that it disappears.</li>
<li>When the red square appears tap on that as well.</li>
</ol>
Test passes if the proper behavior of the events is observed.
</h4>
<div id="square1" class="square"></div>
<iframe id="innerFrame" src="resources/pointerevent_attributes_hoverable_pointers-iframe.html"></iframe>
<div class="spacer"></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -20,11 +20,10 @@
<li> Move your mouse out of the black rectangle. pointerout and pointerleave should be logged inside of it</li>
<li> Put your mouse over the purple rectangle. pointerover and pointerenter should be logged inside of it.</li>
<li> Move your mouse out of the purple rectangle. pointerout and pointerleave should be logged inside of it</li>
<li> Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged in the black rectangle</li>
<li> Press and hold left mouse button over "Set Capture" button and move mouse a litte inside the button. "gotpointercapture", "pointerover", and "pointerenter" should be logged in the black rectangle</li>
<li> Put your mouse over the purple rectangle and then move it out. Nothing should happen</li>
<li> Put your mouse over the black rectangle. pointerover and pointerenter should be logged inside of it.</li>
<li> Move your mouse out of the black rectangle. pointerout and pointerleave should be logged inside of it</li>
<li> Release left mouse button. "lostpointercapture" should be logged in the black rectangle</li>
<li> Put your mouse over the black rectangle and then move it out. Nothing should happen.</li>
<li> Put your mouse over the purple rectangle and then release left mouse button. "lostpointercapture" should be logged in the black rectangle. Move your mouse in the purple rectangle a little. "pointerout" and "pointerleave" should be logged in the black rectangle. Also "pointerover" and "pointerenter" should be logged in the purple rectangle"</li>
</ol>
</h4>
Test passes if the proper behaviour of the events is observed.
@ -38,6 +37,7 @@
var isPointerCapture = false;
var isRelatedTargetValueTested = false;
var isTargetAuthenticityTested = false;
var lostPointerCaptureReceived = false;
var count = 0;
var detected_pointertypes = {};
@ -54,13 +54,13 @@
var test_pointerover_capture = async_test("pointerover event with capture received");
var test_pointerout_no_capture = async_test("pointerout event without capture received");
var test_pointerout_capture = async_test("pointerout event with capture received");
var test_pointerout_after_capture = async_test("pointerout event after lostpointercapture received");
var test_pointerenter_no_capture = async_test("pointerenter event without capture received");
var test_pointerenter_capture = async_test("pointerenter event with capture received");
var test_pointerleave_no_capture = async_test("pointerleave event without capture received");
var test_pointerleave_capture = async_test("pointerleave event with capture received");
var test_pointerleave_after_capture = async_test("pointerleave event after lostpointercapture received");
window.onload = function() {
on_event(captureButton, 'pointerdown', function(e) {
@ -77,6 +77,7 @@
on_event(target0, 'lostpointercapture', function(e) {
isPointerCapture = false;
lostPointerCaptureReceived = true;
test_lostpointercapture.done();
log("lostpointercapture", target0);
});
@ -92,15 +93,15 @@
test_pointerover_capture.done();
if (!isRelatedTargetValueTested) {
test(function() {
assert_true(event.relatedTarget==null, "relatedTarget is null when the capture is set")
}, "relatedTarget is null when the capture is set. relatedTarget is " + event.relatedTarget);
assert_not_equals(event.relatedTarget, null, "relatedTarget should behave the same as when the capture is not set")
}, "relatedTarget is not null for boundary events even when the capture is set.");
isRelatedTargetValueTested = true;
}
var hitTest = document.elementFromPoint(event.clientX, event.clientY);
if(event.target !== hitTest && !isTargetAuthenticityTested) {
test(function () {
assert_unreached("pointerover for this target shouldn't trigger events on capture target");
}, "pointerover should only trigger over the black rectangle");
assert_not_equals(event.target, hitTest, "pointerover should be fired on capture target even if the pointer it not over the capture target");
}, "pointerover should trigger the black rectangle even when pointer is not over black rectangle.");
isTargetAuthenticityTested = true;
}
}
@ -112,10 +113,16 @@
on_event(target0, "pointerout", function (event) {
log("pointerout", target0);
if(isPointerCapture) {
test_pointerout_capture.done();
test(function() {
assert_unreached("pointerout shouldn't be sent to captured node as all the events are targeted at the capturing node");
}, "pointerout shouldn't be sent to captured node as all the events are targeted at the capturing node.");
}
else {
test_pointerout_no_capture.done();
if (lostPointerCaptureReceived) {
test_pointerout_after_capture.done();
} else {
test_pointerout_no_capture.done();
}
}
});
@ -132,10 +139,16 @@
on_event(target0, "pointerleave", function (event) {
log("pointerleave", target0);
if(isPointerCapture) {
test_pointerleave_capture.done();
test(function() {
assert_unreached("pointerleave shouldn't be sent to captured node as all the events are targeted at the capturing node");
}, "pointerleave shouldn't be sent to captured node as all the events are targeted at the capturing node.");
}
else {
test_pointerleave_no_capture.done();
if (lostPointerCaptureReceived) {
test_pointerleave_after_capture.done();
} else {
test_pointerleave_no_capture.done();
}
}
});
@ -183,4 +196,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -31,6 +31,8 @@
var testHeight = 5;
var testTiltX = -45;
var testTiltY = 30;
var testButton = 0;
var testButtons = 1;
var testPressure = 0.4;
var testIsPrimary = true;
@ -41,6 +43,8 @@
["custom cancelable", event.cancelable, testCancelable],
["custom pointerId", event.pointerId, testPointerId],
["custom pointerType", event.pointerType, testPointerType],
["custom button", event.button, testButton],
["custom buttons", event.buttons, testButtons],
["custom width", event.width, testWidth],
["custom height", event.height, testHeight],
["custom clientX", event.clientX, testClientX],
@ -81,6 +85,8 @@
clientY: testClientY,
tiltX: testTiltX,
tiltY: testTiltY,
button: testButton,
buttons: testButtons,
pressure: testPressure,
isPrimary: testIsPrimary
});

View File

@ -61,6 +61,12 @@
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++) {
@ -73,8 +79,9 @@
}
on_event(target0, "pointerup", function (e) {
// Immediately after firing the pointerup or pointercancel events, a user agent must run the steps
// as if the releasePointerCapture() method has been called
// 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");
@ -120,4 +127,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -18,7 +18,7 @@
This test checks if lostpointercapture is handled asynchronously and prior to all subsequent events.
Complete the following actions:
<ol>
<li>Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged inside of the black rectangle
<li>Press and hold left mouse button over "Set Capture" button and move a little. "gotpointercapture" should be logged inside of the black rectangle
<li>"lostpointercapture" should be logged inside of the black rectangle after pointerup
</ol>
</h4>
@ -31,6 +31,9 @@
var detected_pointertypes = {};
var detected_pointerEvents = new Array();
var pointerdown_event = null;
var firstPointermoveReceived = false; // To handle the first pointermove right after gotpointercapture which gotpointercapture was sent right before it.
var firstPointeroverReceived = false; // To handle the first pointerover right after gotpointercapture which gotpointercapture was sent right before it.
var firstPointerenterReceived = false; // To handle the first pointeenter right after gotpointercapture which gotpointercapture was sent right before it.
var test_pointerEvent = async_test("lostpointercapture is dispatched prior to subsequent events"); // set up test harness
@ -100,9 +103,20 @@
test_pointerEvent.done(); // complete test
}
else {
if (testStarted && pointerdown_event != null && pointerdown_event.pointerId === event.pointerId && event.type != "pointerup") {
detected_pointerEvents.push(event.type);
eventRcvd = true;
if (testStarted && pointerdown_event != null && pointerdown_event.pointerId === event.pointerId) {
if (event.type == "pointermove" && !firstPointermoveReceived) {
firstPointermoveReceived = true;
}
else if (event.type == "pointerenter" && !firstPointerenterReceived) {
firstPointerenterReceived = true;
}
else if (event.type == "pointerover" && !firstPointeroverReceived) {
firstPointeroverReceived = true;
}
else if (event.type != "pointerup") {
detected_pointerEvents.push(event.type);
eventRcvd = true;
}
}
}
});
@ -115,4 +129,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -1,60 +0,0 @@
<!doctype html>
<html>
<!--
Test cases for Pointer Events v1 spec
This document references Test Assertions (abbrev TA below) written by Cathy Chan
http://www.w3.org/wiki/PointerEvents/TestAssertions
-->
<head>
<title>Pointer Events pointerdown tests</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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script>
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerdown event received");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
var pointerover_event;
on_event(target0, "pointerover", function (event) {
detected_pointertypes[event.pointerType] = true;
pointerover_event = event;
check_PointerEvent(event);
});
on_event(target0, "pointerdown", function (event) {
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, pointerover_event.pointerType, "pointerType is same for pointerover and pointerdown");
assert_equals(event.isPrimary, pointerover_event.isPrimary, "isPrimary is same for pointerover and pointerdown");
});
test_pointerEvent.done();
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Events pointerdown tests</h1>
<div id="target0">
Start with your pointing device outside of this box, then click here.
</div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,53 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: Dispatch pointerenter. </title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerenter event must be dispatched."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerenter event"); // set up test harness
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerenter", function (event) {
detected_pointertypes[event.pointerType] = true;
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.type, "pointerenter", "pointer event received: " + event.type);
});
test_pointerEvent.done(); // complete test
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointerenter</h1>
<h4>
Test Description:
When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerenter event must be dispatched.
</h4>
<div id="target0">
Use the mouse or pen to move over this box.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,77 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: Dispatch pointerenter. (nohover)</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="When a pointing device that does not support hover is moved into the hit test boundaries of an element
or one of its descendants as a result of a pointerdown event, the pointerenter event must be dispatched. "/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerenter event"); // set up test harness
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var test_pointerEnter;
var f_pointerenter_rcvd = false;
var pointerenter_event;
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerdown", function (event) {
if(event.pointerType == 'touch') {
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.type, "pointerdown", "pointer event received: " + event.type);
assert_true(f_pointerenter_rcvd, "pointerenter event should have been received before pointerdown");
assert_equals(event.pointerType, pointerenter_event.pointerType, "pointerType is same for pointerenter and pointerdown");
assert_equals(event.isPrimary, pointerenter_event.isPrimary, "isPrimary is same for pointerenter and pointerdown");
});
test_pointerEvent.done(); // complete test
}
});
on_event(target0, "pointerenter", function (event) {
detected_pointertypes[event.pointerType] = true;
if(event.pointerType == 'touch') {
pointerenter_event = event;
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.type, "pointerenter", "pointer event received: " + event.type);
});
f_pointerenter_rcvd = true;
}
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointerenter (nohover)</h1>
<!--
<h4>
Test Description:
When a pointing device that does not support hover is moved into the hit test boundaries of an element or one of its
descendants as a result of a pointerdown event, the pointerenter event must be dispatched.
</h4>
<br />
-->
<div id="target0">
Tap here.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,68 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerleave after pointerup</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 type="text/javascript" src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<h2>pointerleave after pointerup</h2>
<h4>Test Description: This test checks if pointerleave event triggers for devices that don't support hover. Tap the black rectangle. </h4>
<p>Note: this test is only for devices that do not support hover.</p>
<div id="target0"></div>
<script>
var test_pointerleave = async_test("pointerleave event received");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var eventTested = false;
var isPointerupReceived = false;
var pointerup_event = null;
var detected_pointertypes = {};
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerup", function (event) {
detected_pointertypes[event.pointerType] = true;
pointerup_event = event;
});
// For input devices that do not support hover, a pointerleave event must follow the pointerup event.
// TA: 3.6
on_event(target0, "pointerleave", function (event) {
if(event.pointerType == 'touch') {
if(pointerup_event != null) {
if(eventTested == false) {
eventTested = true;
test_pointerleave.step(function() {
assert_equals(event.pointerType, pointerup_event.pointerType, "pointerType is same for pointerup and pointerleave");
assert_equals(event.isPrimary, pointerup_event.isPrimary, "isPrimary is same for pointerup and pointerleave");
});
test_pointerleave.done();
}
}
else {
test_pointerleave.step(function() {
assert_unreached("pointerleave received before pointerup");
}, "pointerleave received before pointerup");
}
}
});
}
</script>
<h1>Pointer Events pointerleave tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,56 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: Dispatch pointerleave (mouse). </title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="When a pointing device that has continuous position (such as a mouse) leaves the hit test boundaries of an element, the pointerleave event must be dispatched."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerleave event"); // set up test harness;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerleave", function (event) {
detected_pointertypes[event.pointerType] = true;
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, "mouse", "Test should be run using a mouse as input.");
assert_equals(event.type, "pointerleave", "The " + event.type + " event was received.");
});
test_pointerEvent.done(); // complete test
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointerleave (mouse)</h1>
<!--
<h4>
Test Description:
When a pointing device that has continuous position (such as a mouse) leaves the hit test boundaries of an element, the pointerleave event must be dispatched.
</h4>
<br />
-->
<div id="target0">
Use a mouse to move over then out of this element
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,54 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: Dispatch pointerleave (touch). </title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="When a pointing device that does not support hover (such as a finger) leaves the hit test boundaries as a result of a pointerup event, the pointerleave event must be dispatched. "/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerleave event");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerleave", function (event) {
detected_pointertypes[event.pointerType] = true;
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, "touch", "Test should be run using touch input");
assert_equals(event.type, "pointerleave", "The " + event.type + " event received");
});
test_pointerEvent.done(); // complete test
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointerleave (touch)</h1>
<h4>
Test Description:
When a pointing device that does not support hover (such as a finger) leaves the hit test boundaries as a result of a pointerup event, the pointerleave event must be dispatched.
</h4>
<br />
<div id="target0">
Use touch to tap on this box.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerType conservation</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 src="pointerevent_support.js"></script>
<script src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<!--
<h1>pointerType conservation</h1>
<h4>Test Description: This test checks if pointerType attribute defined properly.</h4>
<div id="instructions">
Press and move a mouse button, touch contact or pen contact on the black rectangle. Only use one device per test run.
</div>
<p>Note: This test may be run with different pointer devices, however only one device should be used per test run.
<p>
-->
<div id="target0"></div>
<script>
var eventTested = false;
var pointerTypeGot = false;
var pointerdown_event;
var detected_pointertypes = {};
setup({ explicit_done: true });
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerover", function(event) {
detected_pointertypes[ event.pointerType ] = true;
});
// The pointerType attribute of a pointermove event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
// TA: 5.1
on_event(target0, "pointerdown", function (event) {
pointerdown_event = event;
pointerTypeGot = true;
});
on_event(target0, "pointermove", function (event) {
if(pointerTypeGot == true) {
if(!eventTested) {
test(function() {
assert_equals(event.pointerId, pointerdown_event.pointerId, "pointer IDs are equal: ");
assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType of pointermove event matches pointerdown event: ");
}, "pointerType is dispatched properly");
}
done();
}
});
}
</script>
<h1>Pointer Events pointerType conservation tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,47 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerout</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 type="text/javascript" src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<h2>pointerout</h2>
<h4>Test Description: This test checks if pointerout event triggers. Put your mouse over the black rectangle and then move it out of the rectangle boundaries. If you are using touchscreen tap the black rectangle. </h4>
<div id="target0" style="background: black"></div>
<script>
var test_pointerEvent = async_test("pointerout event received");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var eventTested = false;
var detected_pointertypes = {};
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerout", function (event) {
detected_pointertypes[event.pointerType] = true;
if (eventTested == false) {
eventTested = true;
check_PointerEvent(event);
test_pointerEvent.done();
}
});
}
</script>
<h1>Pointer Events pointerout tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,68 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerout</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 type="text/javascript" src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<h2>pointerout</h2>
<h4>Test Description: This test checks if pointerout event triggers for devices that don't support hover. Tap the black rectangle. </h4>
<p>Note: this test is only for devices that do not support hover.</p>
<div id="target0"></div>
<script>
var test_pointerout = async_test("pointerout event received");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var eventTested = false;
var pointerup_event = null;
var detected_pointertypes = {};
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerup", function (event) {
detected_pointertypes[event.pointerType] = true;
pointerup_event = event;
});
// For input devices that do not support hover, a pointerout event must follow the pointerup event.
// TA: 3.6
on_event(target0, "pointerout", function (event) {
if(event.pointerType == 'touch') {
if(pointerup_event != null) {
if(eventTested == false) {
test_pointerout.step(function() {
assert_equals(event.pointerType, pointerup_event.pointerType, "pointerType is same for pointerup and pointerout");
assert_equals(event.isPrimary, pointerup_event.isPrimary, "isPrimary is same for pointerup and pointerout");
});
eventTested = true;
test_pointerout.done();
}
}
else {
test_pointerout.step(function() {
assert_true(false,
"pointerup received before pointerout");
}, "pointerup received before pointerout");
}
}
});
}
</script>
<h1>Pointer Events pointerout tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,53 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: Dispatch pointerover. </title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched. "/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerover is dispatched"); // set up test harness;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerover", function (event) {
detected_pointertypes[event.pointerType] = true;
test_pointerEvent.step(function () {
check_PointerEvent(event);
assert_equals(event.type, "pointerover", "Pointer Event received");
});
test_pointerEvent.done(); // complete test
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointerover.</h1>
<h4>Test Description:
When a pointing device is moved into the hit test boundaries of an element, the pointerover event must be dispatched.
</h4>
<br />
<div id="target0">
Use mouse, touch or pen to hover or contact this element..
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,66 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: If a pointer event is initiated by a mouse device, then the pointerType must be "mouse"</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="If a pointer event is initiated by a mouse device, then the pointerType must be 'mouse'."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointer event have pointerType as mouse"); // set up test harness
var eventTested = false;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function eventHandler(event) {
detected_pointertypes[event.pointerType] = true;
if(!eventTested && event.type == "pointerover") {
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, "mouse", "Verify event.pointerType is 'mouse'.");
});
eventTested = true;
}
if (event.type == "pointerup") {
test_pointerEvent.done(); // complete test
}
}
function run() {
var target0 = document.getElementById("target0");
// listen for all events.
for (var i = 0; i < All_Pointer_Events.length; i++) {
on_event(target0, All_Pointer_Events[i], eventHandler);
}
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointer events with pointerType equal to "mouse"</h1>
<!--
<h4>Test Description:
If a pointer event is initiated by a mouse device, then the pointerType must be 'mouse'.
</h4>
<br />
-->
<div id="target0">
Using the mouse, click this element.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,64 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: If a pointer event is initiated by a pen device, then the pointerType must be "pen"</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="If a pointer event is initiated by a pen device, then the pointerType must be 'pen'."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointer event has pointerType as pen"); // set up test harness
var eventTested = false;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function eventHandler(event) {
detected_pointertypes[event.pointerType] = true;
if(!eventTested) {
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, "pen", "Verify event.pointerType is 'pen'.");
});
eventTested = true;
}
if (event.type == "pointerup") {
test_pointerEvent.done(); // complete test
}
}
function run() {
var target0 = document.getElementById("target0");
// listen for all events.
for (var i = 0; i < All_Pointer_Events.length; i++) {
on_event(target0, All_Pointer_Events[i], eventHandler);
}
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointer events with pointerType equal to "pen"</h1>
<!--
<h4>Test Description:
If a pointer event is initiated by a pen device, then the pointerType must be 'pen'.
</h4>
<br />
-->
<div id="target0">
Using pen, tap here.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,65 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: If a pointer event is initiated by a touch device, then the pointerType must be "touch"</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="If a pointer event is initiated by a touch device, then the pointerType must be 'touch'."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointer event has pointerType as touch"); // set up test harness
var eventTested = false;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function eventHandler(event) {
detected_pointertypes[event.pointerType] = true;
if(!eventTested) {
check_PointerEvent(event);
test_pointerEvent.step(function () {
assert_equals(event.pointerType, "touch", "Verify event.pointerType is 'touch'.");
});
eventTested = true;
}
if (event.type == "pointerup") {
test_pointerEvent.done(); // complete test
}
}
function run() {
var target0 = document.getElementById("target0");
// listen for all events.
for (var i = 0; i < All_Pointer_Events.length; i++) {
on_event(target0, All_Pointer_Events[i], eventHandler);
}
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: Dispatch pointer events with pointerType equal to "touch"</h1>
<!--
<h4>Test Description:
If a pointer event is initiated by a touch device, then the pointerType must be 'touch'.
</h4>
<br />
-->
<div id="target0">
Using touch, tap here.
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,45 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerup</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 type="text/javascript" src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<h1>pointerup</h1>
<h4>Test Description: This test checks if pointerup event triggers. Press mouse left button and release it over the black rectangle or tap it if you are using a touchscreen.</h4>
<div id="target0" style="background:black"></div>
<script>
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerup event received");
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerup", function (event) {
detected_pointertypes[event.pointerType] = true;
test_pointerEvent.step(function () {
check_PointerEvent(event);
assert_equals(event.type, "pointerup", "Pointer Event received.");
});
test_pointerEvent.done();
});
}
</script>
<h1>Pointer Events pointerup tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,66 +0,0 @@
<!doctype html>
<html>
<head>
<title>Pointer Event: pointerup has same isPrimary as last pointerdown with the same pointerId</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<meta name="assert" content="The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<!-- /resources/testharness.js -->
<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 type="text/javascript" src="mochitest_support_internal.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerup has same isPrimary as last pointerdown"); // set up test harness
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var pointerup_event = null;
var pointerdown_event = null;
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerup", function (event) {
if (pointerdown_event != null) {
test_pointerEvent.step(function () {
assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerup.pointerId should be the same as pointerdown.pointerId.");
assert_equals(event.isPrimary, pointerdown_event.isPrimary, "pointerup.isPrimary should be the same as pointerdown.isPrimary.");
});
pointerup_event = event;
test_pointerEvent.done(); // complete test
}
});
on_event(target0, "pointerdown", function (event) {
pointerdown_event = event;
detected_pointertypes[event.pointerType] = true;
});
}
</script>
</head>
<body onload="run()">
<h1>Pointer Event: pointerup has the same isPrimary as last pointerdown with the same pointerId</h1>
<!--
<h4>Test Description:
The isPrimary attribute of a pointerup event must have the same value as the isPrimary attribute of the last pointerdown event with the same pointerId attribute.
</h4>
<div id="instructions">
Press and release a mouse button, touch contact or pen contact on this element. Only use one device per test run.
</div>
-->
<div id="target0" style="touch-action: none;">
</div>
<div id="complete-notice">
<p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!doctype html>
<html>
<head>
<title>pointerType conservation</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 src="pointerevent_support.js"></script>
<script src="mochitest_support_internal.js"></script>
</head>
<body onload="run()">
<h1>pointerType conservation</h1>
<!--
<h4>Test Description: This test checks if pointerType attribute defined properly.</h4>
<div id="instructions">
Press and release a mouse button, touch contact or pen contact on the black rectangle. Only use one device per test run.
</div>
<p>Note: This test may be run with different pointer devices, however only one device should be used per test run.
<p>
-->
<div id="target0"></div>
<script>
var eventTested = false;
var pointerTypeGot = false;
var pointerdown_event;
var detected_pointertypes = {};
setup({ explicit_done: true });
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
on_event(target0, "pointerover", function(event) {
detected_pointertypes[ event.pointerType ] = true;
});
// The pointerType attribute of a pointerup event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
// TA: 3.1
on_event(target0, "pointerdown", function (event) {
pointerdown_event = event;
pointerTypeGot = true;
});
on_event(target0, "pointerup", function (event) {
if(pointerTypeGot == true) {
if(!eventTested) {
test(function() {
assert_equals(event.pointerId, pointerdown_event.pointerId, "pointer IDs are equal: ");
assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType of pointerup event matches pointerdown event: ");
}, "pointerType is dispatched properly");
}
done();
}
});
}
</script>
<h1>Pointer Events pointerType conservation tests</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Refresh the page to run the tests again with a different pointer type.</p>
</div>
<div id="log"></div>
</body>
</html>

View File

@ -14,17 +14,21 @@
<script type="text/javascript">
var detected_pointertypes = {};
var test_pointerEvent = async_test("lostpointercapture: subsequent events to target."); // set up test harness
var suppressedEventsFail = false;
// showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent".
add_completion_callback(showPointerTypes);
var captured_event;
var test_done = false;
var overEnterEventsFail = false;
var outLeaveEventsFail = false;
var f_gotPointerCapture = false;
var f_lostPointerCapture = false;
function listenerEventHandler(event) {
if (test_done)
return;
detected_pointertypes[event.pointerType] = true;
if (event.type == "gotpointercapture") {
f_gotPointerCapture = true;
@ -35,12 +39,20 @@
f_gotPointerCapture = false;
check_PointerEvent(event);
}
else if(event.type == "pointerover" || event.type == "pointerenter" || event.type == "pointerout" || event.type == "pointerleave") {
if(!suppressedEventsFail) {
else if(event.type == "pointerover" || event.type == "pointerenter") {
if(!overEnterEventsFail) {
test(function() {
assert_true(false, "Suppressed events were received");
}, "Suppressed events were received");
suppressedEventsFail = true;
assert_true(f_gotPointerCapture, "pointerover/enter should not be received when the target doesn't have capture and pointer is not over it.");
}, "pointerover/enter should not be received when the target doesn't have capture and pointer is not over it.");
overEnterEventsFail = true;
}
}
else if(event.type == "pointerout" || event.type == "pointerleave") {
if(!outLeaveEventsFail) {
test(function() {
assert_true(f_lostPointerCapture, "pointerout/leave should not be received unless the target just lost the capture.");
}, "pointerout/leave should not be received unless the target just lost the capture.");
outLeaveEventsFail = true;
}
}
else if (event.pointerId == captured_event.pointerId) {
@ -50,19 +62,21 @@
}
else {
// if any other events are received after releaseCapture, then the test fails
test_pointerEvent.step(function () {
assert_true(false, event.target.id + "-" + event.type + " should be handled by target element handler");
});
test(function () {
assert_unreached(event.target.id + "-" + event.type + " should be handled by target element handler");
}, "No other events should be recieved by capturing node after release");
}
}
}
function targetEventHandler(event) {
if (test_done)
return;
if (f_gotPointerCapture) {
if(event.type != "pointerout" && event.type != "pointerleave") {
test_pointerEvent.step(function () {
assert_true(false, "The Target element should not have received any events while capture is active. Event recieved:" + event.type + ". ");
});
test(function () {
assert_unreached("The Target element should not have received any events while capture is active. Event recieved:" + event.type + ". ");
}, "The target element should not receive any events while capture is active");
}
}
@ -78,6 +92,7 @@
});
if (event.type == "pointerup") {
test_pointerEvent.done(); // complete test
test_done = true;
}
}
}
@ -116,4 +131,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -15,9 +15,9 @@
<h4>
Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions:
<ol>
<li> Put your mouse over the lower rectangle. pointerover should be received for the purple rectangle
<li> Put your mouse over the purple rectangle. pointerover should be received for the purple rectangle
<li> Press and hold left mouse button over "Set Capture" button
<li> Put your mouse over the upper rectangle. pointerover should be received for the black rectangle
<li> Move your mouse. pointerover should be received for the black rectangle
<li> Release left mouse button to complete the test.
</ol>
</h4>
@ -67,15 +67,14 @@
}
function run() {
// After invoking the setPointerCapture method on an element, subsequent pointer events for the specified pointer must be targeted at that element.
// Additionally, the relatedTarget property of all such pointer events must be set to null.
// TA: 13.3
// After invoking the setPointerCapture method on an element, subsequent pointer events for the specified pointer must be targeted at that element
// and boundary events should be sent accordingly and relatedTarget should behave normally.
on_event(target0, "pointerover", function (event) {
log("pointerover", document.getElementById('target0'));
if(isPointerCapture && isPointeroverGot) {
test(function() {
assert_true(event.relatedTarget==null, "relatedTarget is null when the capture is set")
}, "relatedTarget is null when the capture is set. relatedTarget is " + event.relatedTarget);
assert_not_equals(event.relatedTarget, null, "relatedTarget should not be null even when the capture is set")
}, "relatedTarget should not be null even when the capture is set.");
done();
}
});
@ -100,4 +99,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -1,11 +1,26 @@
#innerFrame {
position: absolute;
top: 300px;
left: 200px;
height: 100px;
width: 100px;
}
.spacer {
height: 100px;
}
#square1 {
top: 330px;
left: 150px;
background: black;
top: 150px;
left: 100px;
}
#square2 {
top: 50px;
left: 30px;
visibility: hidden;
background: red;
}
.square {
@ -31,6 +46,10 @@ overflow-y: auto;
overflow-x: auto;
}
#scrollTarget {
background: darkblue;
}
.touchActionNone {
touch-action: none;
}

View File

@ -12,10 +12,21 @@ var All_Pointer_Events = [
// Check for conformance to PointerEvent interface
// TA: 1.1, 1.2, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13
function check_PointerEvent(event) {
var pointerTestName = event.pointerType + ' ' + event.type;
function check_PointerEvent(event, testNamePrefix) {
if (testNamePrefix === undefined)
testNamePrefix = "";
// Use expectedPointerType if set otherwise just use the incoming event pointerType in the test name.
var pointerTestName = testNamePrefix + ' ' + (expectedPointerType == null ? event.pointerType : expectedPointerType) + ' ' + event.type;
if (expectedPointerType != null) {
test(function () {
assert_equals(event.pointerType, expectedPointerType, "pointerType should be the same as the requested device.");
}, pointerTestName + " event pointerType is correct.");
}
test(function () {
assert_true(event instanceof PointerEvent, "event is a PointerEvent event");
assert_true(event instanceof event.target.ownerDocument.defaultView.PointerEvent, "event is a PointerEvent event");
}, pointerTestName + " event is a PointerEvent event");
@ -79,6 +90,9 @@ function check_PointerEvent(event) {
assert_greater_than_equal(event.pressure, 0, "pressure is greater than or equal to 0");
assert_less_than_equal(event.pressure, 1, "pressure is less than or equal to 1");
if (event.type === "pointerup") {
assert_equals(event.pressure, 0, "pressure is 0 during pointerup");
}
// TA: 1.7, 1.8
if (event.pointerType === "mouse") {
@ -90,11 +104,12 @@ function check_PointerEvent(event) {
}
}, pointerTestName + ".pressure value is valid");
// Check mouse-specific properties
if (event.pointerType === "mouse") {
// TA: 1.9, 1.10, 1.13
test(function () {
assert_equals(event.width, 1, "width of mouse should be 1");
assert_equals(event.height, 1, "height of mouse should be 1");
assert_equals(event.tiltX, 0, event.type + ".tiltX is 0 for mouse");
assert_equals(event.tiltY, 0, event.type + ".tiltY is 0 for mouse");
assert_true(event.isPrimary, event.type + ".isPrimary is true for mouse");
@ -183,3 +198,47 @@ function rPointerCapture(e) {
catch(e) {
}
}
var globalPointerEventTest = null;
var expectedPointerType = null;
const HOVERABLE_POINTERS = ['mouse', 'pen'];
const NOHOVER_POINTERS = ['touch'];
function MultiPointerTypeTest(testName, types) {
this.testName = testName;
this.types = types;
this.currentTypeIndex = 0;
this.currentTest = null;
this.createNextTest();
}
MultiPointerTypeTest.prototype.skip = function() {
var prevTest = this.currentTest;
this.createNextTest();
prevTest.timeout();
}
MultiPointerTypeTest.prototype.done = function() {
var prevTest = this.currentTest;
this.createNextTest();
if (prevTest != null)
prevTest.done();
}
MultiPointerTypeTest.prototype.createNextTest = function() {
if (this.currentTypeIndex < this.types.length) {
var pointerTypeDescription = document.getElementById('pointerTypeDescription');
document.getElementById('pointerTypeDescription').innerHTML = "Follow the test instructions with <span style='color: red'>" + this.types[this.currentTypeIndex] + "</span>. If you don't have the device <a href='javascript:;' onclick='globalPointerEventTest.skip()'>skip it</a>.";
this.currentTest = async_test(this.types[this.currentTypeIndex] + ' ' + this.testName);
expectedPointerType = this.types[this.currentTypeIndex];
this.currentTypeIndex++;
} else {
document.getElementById('pointerTypeDescription').innerHTML = "";
}
resetTestState();
}
function setup_pointerevent_test(testName, supportedPointerTypes) {
return globalPointerEventTest = new MultiPointerTypeTest(testName, supportedPointerTypes);
}

View File

@ -106,4 +106,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -19,11 +19,11 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: no panning.</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning.</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -16,10 +16,10 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: no panning</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -19,11 +19,11 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: only pans in x direction.</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: only pans in x direction.</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -19,11 +19,11 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: no panning/zooming/etc.</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning/zooming/etc.</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -15,11 +15,11 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll text DOWN. Wait for description update. Expected: pan enabled</h4>
<h4 id="desc">Test Description: Try to scroll text DOWN inside blue rectangle. Wait for description update. Expected: pan enabled</h4>
<p>Note: this test is for touch-devices only</p>
<div id="divParent">
<div class="scroller" id="target0">
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -16,10 +16,10 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: no panning</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: no panning</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div id="scrollTarget">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.

View File

@ -19,11 +19,11 @@
</head>
<body onload="run()">
<h1>Pointer Events touch-action attribute support</h1>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT. Tap Complete button under the rectangle when done. Expected: only pans in y direction.</h4>
<h4 id="desc">Test Description: Try to scroll element DOWN then RIGHT inside blue rectangle. Tap Complete button under the rectangle when done. Expected: only pans in y direction.</h4>
<p>Note: this test is for touch-devices only</p>
<div class="scroller" id="target0">
<div>
<div>
<div id="scrollTarget">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.
Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit

View File

@ -119,4 +119,4 @@
</div>
<div id="log"></div>
</body>
</html>
</html>

View File

@ -14,81 +14,32 @@
<script src="/resources/testharnessreport.js"></script>
<script src="pointerevent_support.js"></script>
<style>
#target0 {
width: 700px;
height: 20px;
touch-action: auto;
}
#target1 {
width: 700px;
height: 20px;
touch-action: none;
background: black;
margin-top: 5px;
touch-action: pan-x;
}
#target2 {
width: 700px;
height: 20px;
touch-action: none;
background: black;
margin-top: 5px;
touch-action: pan-y;
}
#target3 {
width: 700px;
height: 20px;
touch-action: none;
background: black;
margin-top: 5px;
touch-action: none;
}
#target4 {
width: 700px;
height: 20px;
touch-action: none;
background: black;
margin-top: 5px;
touch-action: manipulation;
}
/*
Give some rules below something to override in order to test
that they really are being parsed
*/
.defnone {
touch-action: none;
}
</style>
</head>
<body onload="run()">
<h2>Pointer Events touch-action attribute support</h2>
<h4 id="desc">Test Description: Test will automatically check behaviour of following values: 'auto', 'pan-x', 'pan-y', ' none', 'manipulation'</h4>
<div id="target0"></div>
<div id="target1"></div>
<div id="target2"></div>
<div id="target3"></div>
<div id="target4"></div>
<h4 id="desc">Test Description: Test will automatically check parsing behaviour of various touch-action combinations.</h4>
<script type='text/javascript'>
var detected_pointertypes = {};
setup({ explicit_done: true });
function run() {
var target0 = document.getElementById('target0');
var target1 = document.getElementById('target1');
var target2 = document.getElementById('target2');
var target3 = document.getElementById('target3');
var target4 = document.getElementById('target4');
var tests = document.querySelectorAll('.test');
//TA 15.20
test(function() {
assert_true(getComputedStyle(target0).touchAction == 'auto', "'auto' is set properly");
}, "'auto' is set properly");
test(function() {
assert_true(getComputedStyle(target1).touchAction == 'pan-x', "'pan-x' is corrected properly");
}, "'pan-x' is corrected properly");
test(function() {
assert_true(getComputedStyle(target2).touchAction == 'pan-y', "'pan-y' is set properly");
}, "'pan-y' is set properly");
test(function() {
assert_true(getComputedStyle(target3).touchAction == 'none', "'none' is set properly");
}, "'none' is set properly");
test(function() {
assert_true(getComputedStyle(target4).touchAction == 'manipulation', "'manipulation' is set properly");
}, "'manipulation' is set properly");
for (var i = 0; i < tests.length; i++) {
test(function() {
var style = window.getComputedStyle(tests[i]);
assert_equals(tests[i].attributes.expected.value, style.touchAction);
}, tests[i].id);
}
done();
}
</script>
@ -97,5 +48,44 @@
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>
<div id="log"></div>
<div class="test" id="default" expected="auto"></div>
<div class="test defnone" id="stylesheet-none" expected="none"></div>
<div class="test defnone" id="explicit-auto" style="touch-action: auto;" expected="auto"></div>
<div class="test" id="explicit-pan-x" style="touch-action: pan-x;" expected="pan-x"></div>
<div class="test" id="explicit-pan-left" style="touch-action: pan-left;" expected="pan-left"></div>
<div class="test" id="explicit-pan-right" style="touch-action: pan-right;" expected="pan-right"></div>
<div class="test" id="explicit-pan-y" style="touch-action: pan-y;" expected="pan-y"></div>
<div class="test" id="explicit-pan-up" style="touch-action: pan-up;" expected="pan-up"></div>
<div class="test" id="explicit-pan-down" style="touch-action: pan-down;" expected="pan-down"></div>
<div class="test" id="explicit-pan-x-pan-y" style="touch-action: pan-x pan-y;" expected="pan-x pan-y"></div>
<div class="test" id="explicit-pan-y-pan-x" style="touch-action: pan-y pan-x;" expected="pan-x pan-y"></div>
<div class="test" id="explicit-pan-left-pan-up" style="touch-action: pan-left pan-up;" expected="pan-left pan-up"></div>
<div class="test" id="explicit-pan-left-pan-down" style="touch-action: pan-left pan-down;" expected="pan-left pan-down"></div>
<div class="test" id="explicit-pan-right-pan-up" style="touch-action: pan-right pan-up;" expected="pan-right pan-up"></div>
<div class="test" id="explicit-pan-right-pan-down" style="touch-action: pan-right pan-down;" expected="pan-right pan-down"></div>
<div class="test" id="explicit-pan-up-pan-left" style="touch-action: pan-up pan-left;" expected="pan-left pan-up"></div>
<div class="test" id="explicit-pan-up-pan-right" style="touch-action: pan-up pan-right;" expected="pan-right pan-up"></div>
<div class="test" id="explicit-pan-down-pan-left" style="touch-action: pan-down pan-left;" expected="pan-left pan-down"></div>
<div class="test" id="explicit-pan-down-pan-right" style="touch-action: pan-down pan-right;" expected="pan-right pan-down"></div>
<div class="test" id="explicit-manipulation" style="touch-action: manipulation;" expected="manipulation"></div>
<div class="test" id="explicit-none" style="touch-action: none;" expected="none"></div>
<div class="test" id="explicit-invalid-1" style="touch-action: bogus;" expected="auto"></div>
<div class="test defnone" id="explicit-invalid-2" style="touch-action: auto pan-x;" expected="none"></div>
<div class="test" id="explicit-invalid-3" style="touch-action: pan-y none;" expected="auto"></div>
<div class="test" id="explicit-invalid-4" style="touch-action: pan-x pan-x;" expected="auto"></div>
<div class="test" id="explicit-invalid-5" style="touch-action: manipulation pan-x;" expected="auto"></div>
<div class="test" id="explicit-invalid-6" style="touch-action: pan-x pan-left;" expected="auto"></div>
<div class="test" id="explicit-invalid-7" style="touch-action: auto pan-left;" expected="auto"></div>
<div class="test" id="explicit-invalid-8" style="touch-action: none pan-left;" expected="auto"></div>
<div class="test" id="explicit-invalid-9" style="touch-action: pan-x pan-right;" expected="auto"></div>
<div class="test" id="explicit-invalid-10" style="touch-action: pan-y pan-up;" expected="auto"></div>
<div class="test" id="explicit-invalid-11" style="touch-action: pan-y pan-down;" expected="auto"></div>
<div class="test" id="explicit-invalid-12" style="touch-action: pan-left pan-right;" expected="auto"></div>
<div class="test" id="explicit-invalid-13" style="touch-action: pan-up pan-down;" expected="auto"></div>
<div style="touch-action: none;">
<div class="test" id="not-inherited" expected="auto"></div>
<div class="test" id="inherit" style="touch-action: inherit;" expected="none"></div>
</div>
<div class="test defnone" id="initial" style="touch-action: initial;" expected="auto"></div>
</body>
</html>
</html>

View File

@ -1,5 +1,9 @@
Directory for Pointer Events Tests
All tests were got from official repository:
Latest Editor's Draft: https://w3c.github.io/pointerevents/
https://github.com/w3c/web-platform-tests/tree/master/pointerevents
Latest W3C Technical Report: http://www.w3.org/TR/pointerevents/
Discussion forum for tests: http://lists.w3.org/Archives/Public/public-test-infra/
Test Assertion table: https://www.w3.org/wiki/PointerEvents/TestAssertions

View File

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
</head>
<body>
<div id="square2" class="square"></div>
</body>
</html>

View File

@ -12,8 +12,6 @@ http://www.w3.org/wiki/PointerEvents/TestAssertions
<script>
function run() {
var target1 = document.getElementById("target1");
var pointerover_event;
var ponterId = null;
var eventList = ['pointerenter', 'pointerover', 'pointermove', 'pointerout', 'pointerleave'];

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test pointerevent attributes for hoverable pointers</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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() {
ok(true, "debug0");
runTestInNewWindow("pointerevent_attributes_hoverable_pointers-manual.html");
}
function executeTest(int_win) {
let iframeWin = int_win.document.getElementById("innerFrame").contentWindow;
// synthesize mouse events with input source = mouse
sendMouseEvent(int_win, "square1", "mousemove", {button:-1});
sendMouseEvent(int_win, "square1", "mousedown");
sendMouseEvent(int_win, "square1", "mouseup");
sendMouseEvent(int_win, "square1", "mousemove", {button:-1,
offsetX:-1,
offsetY:-1});
sendMouseEvent(iframeWin, "square2", "mousemove", {button:-1});
sendMouseEvent(iframeWin, "square2", "mousedown");
sendMouseEvent(iframeWin, "square2", "mouseup");
sendMouseEvent(iframeWin, "square2", "mousemove", {button:-1,
offsetX:-1,
offsetY:-1});
// synthesize mouse events with input source = pen
let inputPen = MouseEvent.MOZ_SOURCE_PEN;
sendMouseEvent(int_win, "square1", "mousemove", {button:-1,
inputSource: inputPen});
sendMouseEvent(int_win, "square1", "mousedown", {inputSource:inputPen});
sendMouseEvent(int_win, "square1", "mouseup", {inputSource:inputPen});
sendMouseEvent(int_win, "square1", "mousemove", {button:-1,
offsetX:-1,
offsetY:-1,
inputSource:inputPen});
sendMouseEvent(iframeWin, "square2", "mousemove", {button:-1,
inputSource:inputPen});
sendMouseEvent(iframeWin, "square2", "mousedown", {inputSource:inputPen});
sendMouseEvent(iframeWin, "square2", "mouseup", {inputSource:inputPen});
sendMouseEvent(iframeWin, "square2", "mousemove", {button:-1,
offsetX:-1,
offsetY:-1,
inputSource:inputPen});
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,31 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_attributes_mouse-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "square1", "mousemove");
sendMouseEvent(int_win, "square1", "mousedown");
sendMouseEvent(int_win, "square1", "mouseup");
sendMouseEvent(int_win, "square1", "mousemove");
sendMouseEvent(int_win, "square1", "mousemove", {offsetX: -1, offSetY: -1});
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,12 +1,8 @@
<!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" />
<title>Test pointerevent attributes for non-hoverable pointers</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="mochitest_support_external.js"></script>
@ -14,10 +10,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
function startTest() {
runTestInNewWindow("pointerevent_pointerover-manual.html");
runTestInNewWindow("pointerevent_attributes_nohover_pointers-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousemove");
sendTouchEvent(int_win, "square1", "touchstart");
sendTouchEvent(int_win, "square1", "touchend");
let iframe = int_win.document.getElementById("innerFrame");
sendTouchEvent(iframe.contentWindow, "square2", "touchstart");
sendTouchEvent(iframe.contentWindow, "square2", "touchend");
}
</script>
</head>

View File

@ -1,28 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerdown-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "log", "mousemove");
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerenter-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,28 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerenter_nohover-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "log", "mousemove");
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerleave_after_pointerup_nohover-manual.html");
}
function executeTest(int_win) {
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerleave_mouse-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousemove");
sendMouseEvent(int_win, "log", "mousemove");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerleave_touch-manual.html");
}
function executeTest(int_win) {
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
function startTest() {
runTestInNewWindow("pointerevent_pointermove-on-chorded-mouse-button.html");
runTestInNewWindow("pointerevent_pointermove_on_chorded_mouse_button-manual.html");
}
function executeTest(int_win) {

View File

@ -1,28 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointermove_pointertype-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mousemove");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerout-manual.html");
}
function executeTest(int_win) {
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerout_after_pointerup_nohover-manual.html");
}
function executeTest(int_win) {
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointertype_mouse-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointertype_pen-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown", {inputSource:MouseEvent.MOZ_SOURCE_PEN});
sendMouseEvent(int_win, "target0", "mouseup", {inputSource:MouseEvent.MOZ_SOURCE_PEN});
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointertype_touch-manual.html");
}
function executeTest(int_win) {
sendTouchEvent(int_win, "target0", "touchstart");
sendTouchEvent(int_win, "target0", "touchend");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerup-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerup_isprimary_same_as_pointerdown-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1,27 +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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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_pointerup_pointertype-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");
sendMouseEvent(int_win, "target0", "mouseup");
}
</script>
</head>
<body>
</body>
</html>

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
function startTest() {
runTestInNewWindow("pointerevent_suppress_compat_events_on_click.html");
runTestInNewWindow("pointerevent_suppress_compat_events_on_click-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
function startTest() {
runTestInNewWindow("pointerevent_suppress_compat_events_on_drag_mouse.html");
runTestInNewWindow("pointerevent_suppress_compat_events_on_drag_mouse-manual.html");
}
function executeTest(int_win) {
sendMouseEvent(int_win, "target0", "mousedown");