Bug 1298255 - [Pointer Event] Update web-platform-test pointerevent_element_haspointercapture-manual.html. f=bevistseng r=smaug
authorStone Shih <sshih@mozilla.com>
Fri, 26 Aug 2016 10:38:59 +0800
changeset 312390 8fdff7ffdcee621fec75557a8e95eefc78624f9d
parent 312389 f615741c86eed245173be02078053f4801403ba4
child 312391 d082b9cabd17101cb872ef5913657f8cb281036b
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1298255
milestone51.0a1
Bug 1298255 - [Pointer Event] Update web-platform-test pointerevent_element_haspointercapture-manual.html. f=bevistseng r=smaug
dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html
dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html
--- a/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_element_haspointercapture-manual.html
@@ -30,31 +30,35 @@
                     detected_pointertypes[e.pointerType] = true;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "before target0.setPointerCapture, target0.hasPointerCapture should be false");
                     });
                     target1.setPointerCapture(e.pointerId);
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
-                                      "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;
                     // hasPointerCapture will return true immediately after a call to setPointerCapture
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), true,
                                       "after target0.setPointerCapture, target0.hasPointerCapture should be true");
                     });
                     // hasPointerCapture will return false immediately after a call to releasePointerCapture
                     target0.releasePointerCapture(e.pointerId);
                     set_capture_to_target0 = false;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "after target0.releasePointerCapture, target0.hasPointerCapture should be false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "after target0.releasePointerCapture, target1.hasPointerCapture should be false");
                     });
                     target0.setPointerCapture(e.pointerId);
                     set_capture_to_target0 = true;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), true,
                                       "after target0.setPointerCapture, target0.hasPointerCapture should be true");
                     });
                 });
@@ -78,34 +82,42 @@
                     set_capture_to_target0 = false;
                 });
 
                 on_event(target0, "lostpointercapture", function (e) {
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "pointerup target0.hasPointerCapture should be false");
                     });
+                });
+
+                on_event(target1, "pointerup", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "pointerup target1.hasPointerCapture should be false");
+                    });
                     test_pointerEvent.done();
                 });
             }
         </script>
     </head>
     <body onload="run()">
         <h1>Element.hasPointerCapture test</h1>
         <!--
         <h4>
             Test Description: This test checks if Element.hasPointerCapture returns value correctly
             <ol>
                 <li> Press black rectangle and do not release
-                <li> Move your pointer to 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>
         <div id="log"></div>
     </body>
 </html>
\ No newline at end of file
--- a/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
+++ b/dom/events/test/pointerevents/test_pointerevent_element_haspointercapture-manual.html
@@ -18,15 +18,17 @@ https://bugzilla.mozilla.org/show_bug.cg
         iframe.src = "pointerevent_element_haspointercapture-manual.html";
       }
       function executeTest(int_win) {
         sendMouseEvent(int_win, "target0", "mousemove");
         sendMouseEvent(int_win, "target0", "mousedown", {button:0});
         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>
   <body>
     <iframe id="testFrame" height="800" width="1000"></iframe>
   </body>
 </html>
--- a/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html
+++ b/testing/web-platform/tests/pointerevents/pointerevent_element_haspointercapture-manual.html
@@ -29,31 +29,35 @@
                     detected_pointertypes[e.pointerType] = true;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "before target0.setPointerCapture, target0.hasPointerCapture should be false");
                     });
                     target1.setPointerCapture(e.pointerId);
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
-                                      "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;
                     // hasPointerCapture will return true immediately after a call to setPointerCapture
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), true,
                                       "after target0.setPointerCapture, target0.hasPointerCapture should be true");
                     });
                     // hasPointerCapture will return false immediately after a call to releasePointerCapture
                     target0.releasePointerCapture(e.pointerId);
                     set_capture_to_target0 = false;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "after target0.releasePointerCapture, target0.hasPointerCapture should be false");
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "after target0.releasePointerCapture, target1.hasPointerCapture should be false");
                     });
                     target0.setPointerCapture(e.pointerId);
                     set_capture_to_target0 = true;
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), true,
                                       "after target0.setPointerCapture, target0.hasPointerCapture should be true");
                     });
                 });
@@ -77,32 +81,40 @@
                     set_capture_to_target0 = false;
                 });
 
                 on_event(target0, "lostpointercapture", function (e) {
                     test_pointerEvent.step(function () {
                         assert_equals(target0.hasPointerCapture(e.pointerId), false,
                                       "pointerup target0.hasPointerCapture should be false");
                     });
+                });
+
+                on_event(target1, "pointerup", function (e) {
+                    test_pointerEvent.step(function () {
+                        assert_equals(target1.hasPointerCapture(e.pointerId), false,
+                                      "pointerup target1.hasPointerCapture should be false");
+                    });
                     test_pointerEvent.done();
                 });
             }
         </script>
     </head>
     <body onload="run()">
         <h1>Element.hasPointerCapture test</h1>
         <h4>
             Test Description: This test checks if Element.hasPointerCapture returns value correctly
             <ol>
                 <li> Press black rectangle and do not release
-                <li> Move your pointer to 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>
         <div id="log"></div>
     </body>
 </html>
\ No newline at end of file