Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html

Issue 2376103007: Import wpt@09907a9c4bcee14986431d53e4381384c7c69107 (Closed)
Patch Set: update platform expectations Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html b/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html
index 81c5881dfab81443a824a375ffff056ee4c9d376..763e17916e9fd2d7f200679658cf65120f1d72c9 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_capture_suppressing_mouse-manual.html
@@ -18,11 +18,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.
@@ -35,6 +34,7 @@
var isPointerCapture = false;
var isRelatedTargetValueTested = false;
var isTargetAuthenticityTested = false;
+ var lostPointerCaptureReceived = false;
var count = 0;
var detected_pointertypes = {};
@@ -51,13 +51,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) {
@@ -74,6 +74,7 @@
on_event(target0, 'lostpointercapture', function(e) {
isPointerCapture = false;
+ lostPointerCaptureReceived = true;
test_lostpointercapture.done();
log("lostpointercapture", target0);
});
@@ -89,15 +90,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;
}
}
@@ -109,10 +110,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();
+ }
}
});
@@ -129,10 +136,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();
+ }
}
});
@@ -180,4 +193,4 @@
</div>
<div id="log"></div>
</body>
-</html>
+</html>

Powered by Google App Engine
This is Rietveld 408576698