Changeset 263835 in webkit


Ignore:
Timestamp:
Jul 2, 2020 1:14:16 AM (4 years ago)
Author:
eocanha@igalia.com
Message:

[GTK] Layout test media/context-menu-actions.html is failing
https://bugs.webkit.org/show_bug.cgi?id=183611

Reviewed by Xabier Rodriguez-Calvar.

Changing to fullscreen is an async operation, so we now use testExpectedEventually() to wait for
the final value.
Simply setting an event handler on video.onwebkitfullscreenchange wouldn't have been enough, since the
event is triggered before the fullscreen operation has been completed and checking for
video.webkitDisplayingFullscreen == true would still fail by then.
Using the 'webkitbeginfullscreen' event isn't possible either, because it's never triggered when
FULLSCREEN_API is enabled.

  • media/context-menu-actions.html: Use asynchronous testing.
  • media/video-test.js:

(testExpectedEventually): Add an optional "timeout" parameter to avoid a test timeout (all the output
would be lost) in case we wait forever for the comparison to evaluate to the expected value.
(reportExpected): Add an optional "explanation" parameter for extra reporting.

  • platform/gtk-wayland/TestExpectations: Unskipped the test.
  • platform/gtk/TestExpectations: Ditto.
Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r263834 r263835  
     12020-07-02  Enrique Ocaña González  <eocanha@igalia.com>
     2
     3        [GTK] Layout test media/context-menu-actions.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=183611
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Changing to fullscreen is an async operation, so we now use testExpectedEventually() to wait for
     9        the final value.
     10        Simply setting an event handler on video.onwebkitfullscreenchange wouldn't have been enough, since the
     11        event is triggered before the fullscreen operation has been completed and checking for
     12        video.webkitDisplayingFullscreen == true would still fail by then.
     13        Using the 'webkitbeginfullscreen' event isn't possible either, because it's never triggered when
     14        FULLSCREEN_API is enabled.
     15
     16        * media/context-menu-actions.html: Use asynchronous testing.
     17        * media/video-test.js:
     18        (testExpectedEventually): Add an optional "timeout" parameter to avoid a test timeout (all the output
     19        would be lost) in case we wait forever for the comparison to evaluate to the expected value.
     20        (reportExpected): Add an optional "explanation" parameter for extra reporting.
     21        * platform/gtk-wayland/TestExpectations: Unskipped the test.
     22        * platform/gtk/TestExpectations: Ditto.
     23
    1242020-07-02  Diego Pino Garcia  <dpino@igalia.com>
    225
  • trunk/LayoutTests/media/context-menu-actions.html

    r120416 r263835  
    22<head>
    33        <script src="media-file.js"></script>
    4         <script src=video-test.js></script>
     4        <script src="video-test.js"></script>
    55        <script>
    66
    7             function playing()
     7            async function playing()
    88            {
    99                if (window.testRunner) {
     
    6565                       consoleWrite("Toggling fullscreen state");
    6666                       items[i].click();
    67                        testExpected("video.webkitDisplayingFullscreen", true, '==');
     67                       await testExpectedEventually("video.webkitDisplayingFullscreen", true, "==", 1000);
    6868                       consoleWrite("");
    6969                    }
     
    7575            }
    7676
    77             function start()
     77            async function start()
    7878            {
    7979                findMediaElement();
  • trunk/LayoutTests/media/video-test.js

    r252793 r263835  
    102102}
    103103
    104 function testExpectedEventually(testFuncString, expected, comparison)
     104function testExpectedEventually(testFuncString, expected, comparison, timeout)
    105105{
    106106    return new Promise(async resolve => {
    107107        var success;
    108108        var observed;
     109        var timeSlept = 0;
    109110        if (comparison === undefined)
    110111            comparison = '==';
    111         while (true) {
     112        while (timeout === undefined || timeSlept < timeout) {
    112113            try {
    113114                let {success, observed} = compare(testFuncString, expected, comparison);
     
    118119                }
    119120                await sleepFor(1);
     121                timeSlept++;
    120122            } catch (ex) {
    121123                consoleWrite(ex);
     
    124126            }
    125127        }
     128        reportExpected(success, testFuncString, comparison, expected, observed, "AFTER TIMEOUT");
     129        resolve();
    126130    });
    127131}
     
    146150var testNumber = 0;
    147151
    148 function reportExpected(success, testFuncString, comparison, expected, observed)
     152function reportExpected(success, testFuncString, comparison, expected, observed, explanation)
    149153{
    150154    testNumber++;
     
    155159        msg = "EXPECTED (<em>" + testFuncString + " </em>" + comparison + " '<em>" + expected + "</em>')";
    156160
    157     if (!success)
     161    if (!success) {
    158162        msg +=  ", OBSERVED '<em>" + observed + "</em>'";
     163        if (explanation !== undefined)
     164            msg += ", " + explanation;
     165    }
    159166
    160167    logResult(success, msg);
  • trunk/LayoutTests/platform/gtk-wayland/TestExpectations

    r263262 r263835  
    8888webkit.org/b/183365 fast/selectors/text-field-selection-window-inactive-text-shadow.html [ ImageOnlyFailure ]
    8989
    90 webkit.org/b/183611 media/context-menu-actions.html [ Failure ]
    9190webkit.org/b/102776 media/track/track-cue-rendering-horizontal.html [ Failure Timeout ]
    9291webkit.org/b/206584 media/video-set-presentation-mode-to-inline.html [ Failure ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r263791 r263835  
    33083308webkit.org/b/183033 http/tests/plugins/supported-plugin-origin-specific-visibility.html [ Failure ]
    33093309
    3310 webkit.org/b/183611 webkit.org/b/198830 media/context-menu-actions.html [ Failure Crash ]
     3310webkit.org/b/198830 media/context-menu-actions.html [ Crash ]
    33113311
    33123312webkit.org/b/183902 fast/dom/frame-loading-via-document-write.html [ Failure ]
Note: See TracChangeset for help on using the changeset viewer.