Unreviewed, tweak test to address flakiness on WK1.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 20:30:21 +0000 (20:30 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 20:30:21 +0000 (20:30 +0000)
* media/media-source/media-source-page-cache-expected.txt:
* media/media-source/media-source-page-cache.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-page-cache-expected.txt
LayoutTests/media/media-source/media-source-page-cache.html

index 5812f13..ab96aa0 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-10  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, tweak test to address flakiness on WK1.
+
+        * media/media-source/media-source-page-cache-expected.txt:
+        * media/media-source/media-source-page-cache.html:
+
 2019-10-10  Youenn Fablet  <youenn@apple.com>
 
         Do not timeout a load intercepted by service worker that receives a response
index 8bdcc97..e3ab965 100644 (file)
@@ -1,6 +1,6 @@
 
-RUN(video.src = URL.createObjectURL(source))
 pageshow - not from cache
+RUN(video.src = URL.createObjectURL(source))
 EVENT(sourceopen)
 RUN(sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock"))
 EXPECTED (source.sourceBuffers[0] == '[object SourceBuffer]') OK
index 85cc316..012ce4a 100644 (file)
         }
     });
 
-    function runTest() {
-        findMediaElement();
+    onload = () => {
+        setTimeout(() => {
+            findMediaElement();
 
-        source = new MediaSource();
-        waitForEvent('sourceopen', sourceOpen, false, false, source);
-        run('video.src = URL.createObjectURL(source)');
+            source = new MediaSource();
+            waitForEvent('sourceopen', sourceOpen, false, false, source);
+            run('video.src = URL.createObjectURL(source)');
+        }, 0);
     }
 
     function sourceOpen() {
         run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
         testExpected('source.sourceBuffers[0]', sourceBuffer);
-        testLink.click(); 
+        setTimeout(() => {
+            testLink.click();
+        }, 0);
     }
     
     </script>
 </head>
-<body onload="runTest()">
+<body>
     <video></video>
     <a id="testLink" href="../../fast/history/resources/page-cache-helper.html" style="display: none">Link</a>
 </body>