Changeset 246753 in webkit


Ignore:
Timestamp:
Jun 24, 2019 12:02:40 PM (5 years ago)
Author:
graouts@webkit.org
Message:

[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
https://bugs.webkit.org/show_bug.cgi?id=197007

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update the test from the Web Platform Tests repository following the fix for https://github.com/web-platform-tests/wpt/issues/16406.

  • web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked-expected.txt: Added.
  • web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html:

LayoutTests:

This test now works reliably, even if it fails the actual assertions.

  • platform/mac/TestExpectations:
Location:
trunk/LayoutTests
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246752 r246753  
     12019-06-24  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
     4        https://bugs.webkit.org/show_bug.cgi?id=197007
     5
     6        Reviewed by Dean Jackson.
     7
     8        This test now works reliably, even if it fails the actual assertions.
     9
     10        * platform/mac/TestExpectations:
     11
    1122019-06-24  Antoine Quint  <graouts@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r246752 r246753  
     12019-06-24  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
     4        https://bugs.webkit.org/show_bug.cgi?id=197007
     5
     6        Reviewed by Dean Jackson.
     7
     8        Update the test from the Web Platform Tests repository following the fix for https://github.com/web-platform-tests/wpt/issues/16406.
     9
     10        * web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked-expected.txt: Added.
     11        * web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html:
     12
    1132019-06-24  Antoine Quint  <graouts@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html

    r244393 r246753  
    44        <title>Pointer Events pointer lock tests</title>
    55        <meta name="viewport" content="width=device-width">
    6         <link rel="stylesheet" type="text/css" href="/external/wpt/pointerevents/pointerevent_styles.css">
     6        <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css">
    77        <script src="/resources/testharness.js"></script>
    88        <script src="/resources/testharnessreport.js"></script>
     
    3737                var div1 = document.getElementById("target");
    3838
    39                 on_event(div1, 'pointerdown', function(event) {
     39                on_event(div1, 'click', function(event) {
    4040                    if (test_state == kStateInit)
    4141                       div1.requestPointerLock();
    42                 });
    43                 on_event(div1, 'pointerup', function(event) {
    44                     if (test_state == kStateLocked)
     42                    else if (test_state == kStateLocked)
    4543                        document.exitPointerLock();
    4644                });
     
    4846                    if (test_state == kStateLocked) {
    4947                        test_pointerEvent.step(function() {
    50                             assert_equals(last_pointer_client_pos['x'], event.clientX)
    51                             assert_equals(last_pointer_client_pos['y'], event.clientY)
    52                             assert_equals(last_pointer_screen_pos['x'], event.screenX)
    53                             assert_equals(last_pointer_screen_pos['y'], event.screenY)
     48                            assert_equals(event.clientX, last_pointer_client_pos['x'], 'clientX')
     49                            assert_equals(event.clientY, last_pointer_client_pos['y'], 'clientY')
     50                            assert_equals(event.screenX, last_pointer_screen_pos['x'], 'screenX')
     51                            assert_equals(event.screenY, last_pointer_screen_pos['y'], 'screenY')
    5452                        });
    5553                    } else {
     
    6462                            assert_equals(document.pointerLockElement, div1, "document.pointerLockElement should be div1.");
    6563                        });
     64
     65                        var actions = new test_driver.Actions();
     66                        pos_x = div1.offsetWidth / 2;
     67                        pos_y = div1.offsetHeight / 2;
     68                        for (var i = 0; i < 10; i++) {
     69                            // Move left and up.
     70                            pos_x += 10;
     71                            pos_y -= 10;
     72                            actions.pointerMove(pos_x, pos_y, {origin: div1});
     73                        }
     74                        actions.pointerDown().pointerUp().send();
    6675                    } else if (test_state == kStateLocked) {
    6776                        test_state = kStateUnlocked;
     
    7382                });
    7483
    75                 var actions = new test_driver.Actions();
    76                 actions.pointerMove(/* x = */ 0, /* y = */ 0, {origin: div1}).pointerDown();
    77 
    78                 pos_x = div1.offsetWidth / 2;
    79                 pos_y = div1.offsetHeight / 2;
    80                 for (var i = 0; i < 10; i++) {
    81                     // Alternatively move left/right and up/down.
    82                     pos_x += ((-1)**i) * i * 10;
    83                     pos_y -= ((-1)**i) * i * 10;
    84                     actions.pointerMove(pos_x, pos_y, {origin: div1});
    85                 }
    86                 actions.pointerUp().send();
     84                new test_driver.Actions().pointerMove(/* x = */ 0, /* y = */ 0, {origin: div1}).pointerDown().pointerUp().send();
    8785            }
    8886        </script>
     
    9492            Test Description: This test checks the pointer event coordinates stays unchanged when pointer is locked.
    9593            <ol>
    96                  <li>Press left button down on the green rectangle and hold it.</li>
    97                  <li>Move the mouse inside the green rectangle.</li>
    98                  <li>Release mouse button. </li>
     94                 <li>Click left mouse button on the green rectangle.</li>
     95                 <li>Move the mouse around.</li>
     96                 <li>Click left mouse button again. </li>
    9997            </ol>
    10098            </ol>
     
    103101        </h4>
    104102        <div id="testContainer">
    105             <div id="target" style="width:800px;height:250px;background:green"></div>
     103            <div id="target" style="width:200px;height:200px;background:green"></div>
    106104        </div>
    107105        <div class="spacer"></div>
  • trunk/LayoutTests/platform/mac/TestExpectations

    r246752 r246753  
    18861886imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_on_chorded_mouse_button_when_locked-manual.html [ Skip ]
    18871887
    1888 webkit.org/b/197007 imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html [ Skip ]
    1889 
    18901888webkit.org/b/192501 [ Debug ] animations/play-state-in-shorthand.html [ Pass Failure ]
    18911889
Note: See TracChangeset for help on using the changeset viewer.