Changeset 207902 in webkit


Ignore:
Timestamp:
Oct 26, 2016 10:43:47 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Modern Media Controls] http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=164013

Unreviewed.

Make the test more robust by only responding to "canplaythrough" once, since it might have fired again
after seeking, and registering for "seeked" events only after we've reached "canplaythrough", and accounting
for the first seek to 50s.

Patch by Antoine Quint <Antoine Quint> on 2016-10-26

  • http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt:
  • http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
  • platform/mac-yosemite/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt: Added.
Location:
trunk/LayoutTests
Files:
2 added
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207901 r207902  
     12016-10-26  Antoine Quint  <graouts@apple.com>
     2
     3        [Modern Media Controls] http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=164013
     5
     6        Unreviewed.
     7
     8        Make the test more robust by only responding to "canplaythrough" once, since it might have fired again
     9        after seeking, and registering for "seeked" events only after we've reached "canplaythrough", and accounting
     10        for the first seek to 50s.
     11
     12        * http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt:
     13        * http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
     14        * platform/mac-yosemite/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt: Added.
     15
    1162016-10-26  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/LayoutTests/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt

    r207835 r207902  
    44
    55
     6Media seeked to currentTime = 50
    67
    78Dispatching click event to the skip back button
    8 
    9 seeked event was dispatched
    10 PASS media.currentTime is 20
     9Media seeked to currentTime = 20
    1110
    1211Dispatching click event to the skip back button
    13 
    14 seeked event was dispatched
    15 PASS media.currentTime is within 0.1 of 0
     12Media seeked to currentTime = 0
    1613
    1714PASS successfullyParsed is true
  • trunk/LayoutTests/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html

    r207835 r207902  
    4747const mediaController = createControls(shadowRoot, media, null);
    4848
    49 media.addEventListener("canplaythrough", event => {
    50     media.currentTime = 50;
    51     clickSkipBackButton();
    52 });
    53 
    5449let numberOfEvents = 0;
    55 media.addEventListener("seeked", function() {
    56     debug("");
    57     debug("seeked event was dispatched");
     50function mediaDidSeek()
     51{
     52    debug("Media seeked to currentTime = " + media.currentTime);
    5853
    5954    numberOfEvents++;
    60 
    61     if (numberOfEvents == 1) {
    62         shouldBe("media.currentTime", "20");
    63         clickSkipBackButton();
    64     } else if (numberOfEvents == 2) {
    65         shouldBeCloseTo("media.currentTime", 0, 0.1);
     55    if (numberOfEvents == 3) {
    6656        debug("");
    6757        shadowRoot.host.remove();
    6858        media.remove();
    6959        finishJSTest();
     60        return;
    7061    }
    71 });
    7262
    73 function clickSkipBackButton()
    74 {
    7563    debug("");
    7664    debug("Dispatching click event to the skip back button");
     
    7866}
    7967
     68function mediaCanPlay()
     69{
     70    media.removeEventListener("canplaythrough", mediaCanPlay);
     71    media.addEventListener("seeked", mediaDidSeek);
     72    media.currentTime = 50;
     73}
     74
     75media.addEventListener("canplaythrough", mediaCanPlay);
     76
    8077</script>
    8178<script src="../../../../../resources/js-test-post.js"></script>
  • trunk/LayoutTests/platform/mac-yosemite/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click-expected.txt

    r207901 r207902  
    44
    55
     6Media seeked to currentTime = 50
    67
    78Dispatching click event to the skip back button
    8 
    9 seeked event was dispatched
    10 PASS media.currentTime is 20
     9Media seeked to currentTime = 20
    1110
    1211Dispatching click event to the skip back button
    13 
    14 seeked event was dispatched
    15 PASS media.currentTime is within 0.1 of 0
     12Media seeked to currentTime = 0.04789115646258504
    1613
    1714PASS successfullyParsed is true
Note: See TracChangeset for help on using the changeset viewer.