Title: [255832] trunk/LayoutTests
Revision
255832
Author
[email protected]
Date
2020-02-05 11:14:20 -0800 (Wed, 05 Feb 2020)

Log Message

Improve stability of webrtc/video-autoplay.html by splitting tests in multiple files
https://bugs.webkit.org/show_bug.cgi?id=207252

Reviewed by Eric Carlson.

webrtc/video-autplay.html is flaky on bots.
On debug bots, removing the video element from the DOM does not always pause it in a timely manner.
To improve reliability, we split tests in individual files.
Removing flakiness expectation from video-autoplay.html since it no longer contains the flaky tests.

* TestExpectations:
* webrtc/video-autoplay-expected.txt:
* webrtc/video-autoplay.html:
* webrtc/video-autoplay1-expected.txt: Added.
* webrtc/video-autoplay1.html: Added.
* webrtc/video-autoplay2-expected.txt: Added.
* webrtc/video-autoplay2.html: Added.
* webrtc/video-autoplay3-expected.txt: Added.
* webrtc/video-autoplay3.html: Added.
* webrtc/video-autoplay4-expected.txt: Added.
* webrtc/video-autoplay4.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (255831 => 255832)


--- trunk/LayoutTests/ChangeLog	2020-02-05 19:10:04 UTC (rev 255831)
+++ trunk/LayoutTests/ChangeLog	2020-02-05 19:14:20 UTC (rev 255832)
@@ -1,3 +1,27 @@
+2020-02-05  youenn fablet  <[email protected]>
+
+        Improve stability of webrtc/video-autoplay.html by splitting tests in multiple files
+        https://bugs.webkit.org/show_bug.cgi?id=207252
+
+        Reviewed by Eric Carlson.
+
+        webrtc/video-autplay.html is flaky on bots.
+        On debug bots, removing the video element from the DOM does not always pause it in a timely manner.
+        To improve reliability, we split tests in individual files.
+        Removing flakiness expectation from video-autoplay.html since it no longer contains the flaky tests.
+
+        * TestExpectations:
+        * webrtc/video-autoplay-expected.txt:
+        * webrtc/video-autoplay.html:
+        * webrtc/video-autoplay1-expected.txt: Added.
+        * webrtc/video-autoplay1.html: Added.
+        * webrtc/video-autoplay2-expected.txt: Added.
+        * webrtc/video-autoplay2.html: Added.
+        * webrtc/video-autoplay3-expected.txt: Added.
+        * webrtc/video-autoplay3.html: Added.
+        * webrtc/video-autoplay4-expected.txt: Added.
+        * webrtc/video-autoplay4.html: Added.
+
 2020-02-05  Diego Pino Garcia  <[email protected]>
 
         [GTK] Gardening, new baselines and update TestExpectations

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (255831 => 255832)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-02-05 19:10:04 UTC (rev 255831)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-02-05 19:14:20 UTC (rev 255832)
@@ -945,8 +945,6 @@
 
 webkit.org/b/206839 http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html [ Pass Failure ]
 
-webkit.org/b/207001 webrtc/video-autoplay.html [ Pass Failure ]
-
 webkit.org/b/207003 tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html [ Pass Failure ]
 
 webkit.org/b/207060 imported/w3c/web-platform-tests/html/webappapis/timers/type-long-setinterval.html [ Pass Failure ]

Modified: trunk/LayoutTests/webrtc/video-autoplay-expected.txt (255831 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay-expected.txt	2020-02-05 19:10:04 UTC (rev 255831)
+++ trunk/LayoutTests/webrtc/video-autoplay-expected.txt	2020-02-05 19:14:20 UTC (rev 255832)
@@ -1,12 +1,7 @@
- 
-  
 
+
 PASS Ensuring autoplay does not work on regular video elements 
 PASS Ensuring autoplay does not work on regular video elements when getUserMedia is on 
 PASS Local media stream autoplay 
 PASS Remote media stream autoplay 
-PASS Granting getUserMedia should not start paused media 1 
-PASS Granting getUserMedia should not start paused media 2 
-PASS Granting getUserMedia should not start paused media 3 
-PASS Granting getUserMedia should not start paused media or media that cannot autoplay due to autoplay restrictions 
 

Modified: trunk/LayoutTests/webrtc/video-autoplay.html (255831 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay.html	2020-02-05 19:10:04 UTC (rev 255831)
+++ trunk/LayoutTests/webrtc/video-autoplay.html	2020-02-05 19:14:20 UTC (rev 255832)
@@ -10,16 +10,6 @@
     </head>
     <body>
         <video id="video" autoplay></video>
-        <br>
-        <video id="video1" loop autoplay playsInline></video>
-        <video id="video2" loop autoplay playsInline></video>
-        <video id="video3" loop autoplay playsInline></video>
-        <video id="video4" loop autoplay playsInline></video>
-        <br>
-        <video id="video10" loop autoplay playsInline></video>
-        <video id="video20" loop autoplay playsInline></video>
-        <video id="video30" loop autoplay playsInline></video>
-        <video id="video40" loop autoplay playsInline></video>
         <script src =""
         <script>
 video = document.getElementById("video");
@@ -72,101 +62,6 @@
         return video.play();
     });
 }, "Remote media stream autoplay");
-
-promise_test(async (test) => {
-    if (window.internals)
-        internals.setMediaElementRestrictions(video1, "");
-
-    video1.src = "" "../media/content/audio-tracks");
-    await video1.play();
-
-    await video1.pause();
-
-    video4.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
-
-    while (video4.paused)
-        await new Promise(resolve => setTimeout(resolve, 50));
-
-    assert_true(video1.paused, "paused video");
-
-    video1.remove();
-}, "Granting getUserMedia should not start paused media 1");
-
-promise_test(async (test) => {
-    if (window.internals)
-        internals.setMediaElementRestrictions(video2, "");
-
-    video2.src = "" "../media/content/audio-tracks");
-    await video2.play();
-
-    let removedVideo2 = video2;
-    removedVideo2.remove();
-
-    let cptr = 0;
-    while (++cptr < 20 && !removedVideo2.paused)
-        await new Promise(resolve => setTimeout(resolve, 50));
-    assert_true(removedVideo2.paused, "out of DOM video should get paused");
-
-    video4.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
-
-    while (video4.paused)
-        await new Promise(resolve => setTimeout(resolve, 50));
-
-    assert_true(removedVideo2.paused, "out of DOM video should not restart after getUserMedia call");
-}, "Granting getUserMedia should not start paused media 2");
-
-promise_test(async (test) => {
-    if (window.internals)
-        internals.setMediaElementRestrictions(video3, "");
-
-    video3.src = "" "../media/content/audio-tracks");
-    await video3.play();
-
-    video4.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
-
-    while (video4.paused)
-        await new Promise(resolve => setTimeout(resolve, 50));
-
-    assert_false(video3.paused, "still playing video");
-
-    video3.remove();
-}, "Granting getUserMedia should not start paused media 3");
-
-promise_test(async (test) => {
-    if (window.internals) {
-        internals.setMediaElementRestrictions(video10, "RequireUserGestureForVideoRateChange");
-        internals.setMediaElementRestrictions(video20, "RequireUserGestureForVideoRateChange");
-        internals.setMediaElementRestrictions(video30, "RequireUserGestureForVideoRateChange");
-        internals.setMediaElementRestrictions(video40, "RequireUserGestureForVideoRateChange");
-    }
-
-    video10.src = "" "../media/content/audio-tracks");
-    video20.src = "" "../media/content/audio-tracks");
-    video30.src = "" "../media/content/audio-tracks");
-
-    await new Promise(resolve => setTimeout(resolve, 50));
-    assert_true(video10.paused, "paused video");
-    assert_true(video20.paused, "paused video");
-    assert_true(video30.paused, "paused video");
-
-    video10.pause();
-    let removedVideo20 = video20;
-    removedVideo20.remove();
-
-    video40.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
-
-    while (video40.paused)
-        await new Promise(resolve => setTimeout(resolve, 50));
-
-    assert_true(video10.paused, "paused video");
-    assert_true(removedVideo20.paused, "out of DOM video");
-    assert_true(video30.paused, "still not autoplaying video");
-
-    video10.remove();
-    video30.remove();
-    video40.remove();
-}, "Granting getUserMedia should not start paused media or media that cannot autoplay due to autoplay restrictions");
-
         </script>
     </body>
 </html>

Added: trunk/LayoutTests/webrtc/video-autoplay1-expected.txt (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay1-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay1-expected.txt	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not start paused video element 
+

Added: trunk/LayoutTests/webrtc/video-autoplay1.html (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay1.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay1.html	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        <title>Testing autoplay with getUserMedia</title>
+        <script src=""
+        <script src=""
+        <script src=""
+        <script src=""
+    </head>
+    <body>
+        <video id="video1" loop autoplay playsInline></video>
+        <video id="video2" loop autoplay playsInline></video>
+        <script>
+promise_test(async (test) => {
+    if (window.internals)
+        internals.setMediaElementRestrictions(video1, "");
+
+    video1.src = "" "../media/content/audio-tracks");
+    await video1.play();
+
+    await video1.pause();
+
+    video2.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
+
+    while (video2.paused)
+        await new Promise(resolve => setTimeout(resolve, 50));
+
+    assert_true(video1.paused, "paused video");
+
+    video1.remove();
+}, "Granting getUserMedia should not start paused video element");
+        </script>
+    </body>
+</html>

Added: trunk/LayoutTests/webrtc/video-autoplay2-expected.txt (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay2-expected.txt	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not start out of DOM video element 
+

Added: trunk/LayoutTests/webrtc/video-autoplay2.html (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay2.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay2.html	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        <title>Testing autoplay with getUserMedia</title>
+        <script src=""
+        <script src=""
+        <script src=""
+        <script src=""
+    </head>
+    <body>
+        <video id="video1" loop autoplay playsInline></video>
+        <video id="video2" loop autoplay playsInline></video>
+        <script>
+promise_test(async (test) => {
+    if (window.internals)
+        internals.setMediaElementRestrictions(video2, "");
+
+    video1.src = "" "../media/content/audio-tracks");
+    await video1.play();
+
+    let removedVideo1 = video1;
+    removedVideo1.remove();
+
+    let cptr = 0;
+    while (++cptr < 50 && !removedVideo1.paused)
+        await new Promise(resolve => setTimeout(resolve, 50));
+    assert_true(removedVideo1.paused, "out of DOM video should get paused");
+
+    video2.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
+
+    while (video2.paused)
+        await new Promise(resolve => setTimeout(resolve, 50));
+
+    assert_true(removedVideo1.paused, "out of DOM video should not restart after getUserMedia call");
+}, "Granting getUserMedia should not start out of DOM video element");
+        </script>
+    </body>
+</html>

Added: trunk/LayoutTests/webrtc/video-autoplay3-expected.txt (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay3-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay3-expected.txt	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not pause playing video element 
+

Added: trunk/LayoutTests/webrtc/video-autoplay3.html (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay3.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay3.html	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        <title>Testing autoplay with getUserMedia</title>
+        <script src=""
+        <script src=""
+        <script src=""
+        <script src=""
+    </head>
+    <body>
+        <video id="video1" loop autoplay playsInline></video>
+        <video id="video2" loop autoplay playsInline></video>
+        <script>
+promise_test(async (test) => {
+    if (window.internals)
+        internals.setMediaElementRestrictions(video1, "");
+
+    video1.src = "" "../media/content/audio-tracks");
+    await video1.play();
+
+    video2.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
+
+    while (video2.paused)
+        await new Promise(resolve => setTimeout(resolve, 50));
+
+    assert_false(video1.paused, "still playing video");
+}, "Granting getUserMedia should not pause playing video element");
+        </script>
+    </body>
+</html>

Added: trunk/LayoutTests/webrtc/video-autoplay4-expected.txt (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay4-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay4-expected.txt	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,4 @@
+  
+
+PASS Granting getUserMedia should not start paused media or media that cannot autoplay due to autoplay restrictions 
+

Added: trunk/LayoutTests/webrtc/video-autoplay4.html (0 => 255832)


--- trunk/LayoutTests/webrtc/video-autoplay4.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/video-autoplay4.html	2020-02-05 19:14:20 UTC (rev 255832)
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        <title>Testing autoplay with getUserMedia</title>
+        <script src=""
+        <script src=""
+        <script src=""
+        <script src=""
+    </head>
+    <body>
+        <video id="video1" loop autoplay playsInline></video>
+        <video id="video2" loop autoplay playsInline></video>
+        <video id="video3" loop autoplay playsInline></video>
+        <video id="video4" loop autoplay playsInline></video>
+        <script>
+promise_test(async (test) => {
+    if (window.internals) {
+        internals.setMediaElementRestrictions(video1, "RequireUserGestureForVideoRateChange");
+        internals.setMediaElementRestrictions(video2, "RequireUserGestureForVideoRateChange");
+        internals.setMediaElementRestrictions(video3, "RequireUserGestureForVideoRateChange");
+        internals.setMediaElementRestrictions(video4, "RequireUserGestureForVideoRateChange");
+    }
+
+    video1.src = "" "../media/content/audio-tracks");
+    video2.src = "" "../media/content/audio-tracks");
+    video3.src = "" "../media/content/audio-tracks");
+
+    await new Promise(resolve => setTimeout(resolve, 50));
+    assert_true(video1.paused, "paused video");
+    assert_true(video2.paused, "paused video");
+    assert_true(video3.paused, "paused video");
+
+    video1.pause();
+    let removedVideo2 = video2;
+    removedVideo2.remove();
+
+    video4.srcObject = await navigator.mediaDevices.getUserMedia({ video : true });
+
+    while (video4.paused)
+        await new Promise(resolve => setTimeout(resolve, 50));
+
+    assert_true(video1.paused, "paused video");
+    assert_true(removedVideo2.paused, "out of DOM video");
+    assert_true(video3.paused, "still not autoplaying video");
+}, "Granting getUserMedia should not start paused media or media that cannot autoplay due to autoplay restrictions");
+
+        </script>
+    </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to