Bug 1298255 - [Pointer Event] Update web-platform-test pointerevent_element_haspointercapture-manual.html. f=bevistseng r=smaug

This commit is contained in:
Stone Shih 2016-08-26 10:38:59 +08:00
parent 2e47d34ebc
commit 1cf8ba2093
3 changed files with 34 additions and 8 deletions

View File

@ -35,7 +35,9 @@
target1.setPointerCapture(e.pointerId);
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"target1.setPointerCapture, target0.hasPointerCapture should be false");
"after target1.setPointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), true,
"after target1.setPointerCapture, target1.hasPointerCapture should be true");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
@ -50,6 +52,8 @@
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target1.hasPointerCapture should be false");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
@ -83,6 +87,13 @@
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"pointerup target0.hasPointerCapture should be false");
});
});
on_event(target1, "pointerup", function (e) {
test_pointerEvent.step(function () {
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"pointerup target1.hasPointerCapture should be false");
});
test_pointerEvent.done();
});
}
@ -95,14 +106,15 @@
Test Description: This test checks if Element.hasPointerCapture returns value correctly
<ol>
<li> Press black rectangle and do not release
<li> Move your pointer to yellow rectangle
<li> Move your pointer to purple rectangle
<li> Release the pointer
<li> Click purple rectangle
</ol>
</h4>
<p>
-->
<div id="target0" style="background:black"></div>
<div id="target1" style="background:yellow"></div>
<div id="target0" touch-action:none></div>
<div id="target1" touch-action:none></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>

View File

@ -23,6 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870
sendMouseEvent(int_win, "target0", "mousemove", {button:0});
sendMouseEvent(int_win, "target1", "mousemove", {button:0});
sendMouseEvent(int_win, "target1", "mouseup", {button:0});
sendMouseEvent(int_win, "target1", "mousedown", {button:0});
sendMouseEvent(int_win, "target1", "mouseup", {button:0});
}
</script>
</head>

View File

@ -34,7 +34,9 @@
target1.setPointerCapture(e.pointerId);
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"target1.setPointerCapture, target0.hasPointerCapture should be false");
"after target1.setPointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), true,
"after target1.setPointerCapture, target1.hasPointerCapture should be true");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
@ -49,6 +51,8 @@
test_pointerEvent.step(function () {
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target0.hasPointerCapture should be false");
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"after target0.releasePointerCapture, target1.hasPointerCapture should be false");
});
target0.setPointerCapture(e.pointerId);
set_capture_to_target0 = true;
@ -82,6 +86,13 @@
assert_equals(target0.hasPointerCapture(e.pointerId), false,
"pointerup target0.hasPointerCapture should be false");
});
});
on_event(target1, "pointerup", function (e) {
test_pointerEvent.step(function () {
assert_equals(target1.hasPointerCapture(e.pointerId), false,
"pointerup target1.hasPointerCapture should be false");
});
test_pointerEvent.done();
});
}
@ -93,13 +104,14 @@
Test Description: This test checks if Element.hasPointerCapture returns value correctly
<ol>
<li> Press black rectangle and do not release
<li> Move your pointer to yellow rectangle
<li> Move your pointer to purple rectangle
<li> Release the pointer
<li> Click purple rectangle
</ol>
</h4>
<p>
<div id="target0" style="background:black"></div>
<div id="target1" style="background:yellow"></div>
<div id="target0" touch-action:none></div>
<div id="target1" touch-action:none></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
</div>