Changeset 206148 in webkit


Ignore:
Timestamp:
Sep 20, 2016 8:47:12 AM (8 years ago)
Author:
Wenson Hsieh
Message:

VideoControlsManager.VideoControlsManagerSingleLargeVideo fails intermittently on the Mac WK2 bot
https://bugs.webkit.org/show_bug.cgi?id=162255

Reviewed by Jer Noble.

This is reproducible by running the test repeatedly in a for loop (locally, I observed that running the test
back-to-back would result in the second one failing). This suggests that even on the runloop after the video
starts playing, the state of the playback controls manager may not be up to date in the UI process. Instead, we
can just spin the runloop until the playback controls are shown, which makes back-to-back tests to succeed and
will probably address flakiness on the bots for this test.

  • TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKit2Cocoa/large-video-with-audio.html:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r206144 r206148  
     12016-09-20  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        VideoControlsManager.VideoControlsManagerSingleLargeVideo fails intermittently on the Mac WK2 bot
     4        https://bugs.webkit.org/show_bug.cgi?id=162255
     5
     6        Reviewed by Jer Noble.
     7
     8        This is reproducible by running the test repeatedly in a for loop (locally, I observed that running the test
     9        back-to-back would result in the second one failing). This suggests that even on the runloop after the video
     10        starts playing, the state of the playback controls manager may not be up to date in the UI process. Instead, we
     11        can just spin the runloop until the playback controls are shown, which makes back-to-back tests to succeed and
     12        will probably address flakiness on the bots for this test.
     13
     14        * TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
     15        (TestWebKitAPI::TEST):
     16        * TestWebKitAPI/Tests/WebKit2Cocoa/large-video-with-audio.html:
     17
    1182016-09-20  Per Arne Vollan  <pvollan@apple.com>
    219
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm

    r206135 r206148  
    132132    // So the expectation is YES.
    133133    [webView loadTestPageNamed:@"large-video-with-audio"];
    134     [webView expectControlsManager:YES afterReceivingMessage:@"playing"];
     134    [webView waitForMediaControlsToShow];
    135135}
    136136
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-video-with-audio.html

    r206033 r206148  
    22<head>
    33<script>
    4     var timeout;
    5 
    6     function go() {
    7         var video = document.getElementsByTagName('video')[0];
    8         timeout = window.setTimeout(notPlaying, 250);
    9         video.addEventListener('playing', playing);
    10         video.play();
    11     }
    12 
    13     function playing() {
    14         window.clearTimeout(timeout);
    15         setTimeout(function() {
    16             try {
    17                 window.webkit.messageHandlers.testHandler.postMessage('playing');
    18             } catch(e) {
    19                 window.location = 'callback:playing';
    20             }
    21         }, 0);
    22     }
    23 
    24     function notPlaying() {
    25         try {
    26             window.webkit.messageHandlers.testHandler.postMessage('not playing');
    27         } catch(e) { }
     4    function play() {
     5        document.getElementsByTagName('video')[0].play();
    286    }
    297</script>
    308</head>
    31 <body onload="go()">
    32     <video id="test-video" src="large-video-with-audio.mp4" controls width=640 height=480></video>
     9<body onload="play()">
     10    <video src="large-video-with-audio.mp4" width=640 height=480></video>
    3311</body>
    3412</html>
Note: See TracChangeset for help on using the changeset viewer.