From 1cf8ba20936e26d2cdddbcf0e31a188910bfd62a Mon Sep 17 00:00:00 2001 From: Stone Shih Date: Fri, 26 Aug 2016 10:38:59 +0800 Subject: [PATCH] Bug 1298255 - [Pointer Event] Update web-platform-test pointerevent_element_haspointercapture-manual.html. f=bevistseng r=smaug --- ...vent_element_haspointercapture-manual.html | 20 +++++++++++++++---- ...vent_element_haspointercapture-manual.html | 2 ++ ...vent_element_haspointercapture-manual.html | 20 +++++++++++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html b/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html index 1e0edfe5b262..1826467fed45 100644 --- a/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html +++ b/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html @@ -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
  1. Press black rectangle and do not release -
  2. Move your pointer to yellow rectangle +
  3. Move your pointer to purple rectangle
  4. Release the pointer +
  5. Click purple rectangle

--> -

-
+
+

The following pointer types were detected: .

diff --git a/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html b/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html index b0fe90646162..ead423ab28c1 100644 --- a/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html +++ b/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html @@ -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}); } diff --git a/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html index b0263b9b6c7f..d447e4e2ac82 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html +++ b/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html @@ -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
  1. Press black rectangle and do not release -
  2. Move your pointer to yellow rectangle +
  3. Move your pointer to purple rectangle
  4. Release the pointer +
  5. Click purple rectangle

-

-
+
+

The following pointer types were detected: .