Title: [259896] branches/safari-609-branch/LayoutTests
Revision
259896
Author
ryanhad...@apple.com
Date
2020-04-10 13:22:22 -0700 (Fri, 10 Apr 2020)

Log Message

Cherry-pick r255832. rdar://problem/61601064

    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.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-609-branch/LayoutTests/ChangeLog (259895 => 259896)


--- branches/safari-609-branch/LayoutTests/ChangeLog	2020-04-10 20:22:18 UTC (rev 259895)
+++ branches/safari-609-branch/LayoutTests/ChangeLog	2020-04-10 20:22:22 UTC (rev 259896)
@@ -1,3 +1,55 @@
+2020-04-10  Ryan Haddad  <ryanhad...@apple.com>
+
+        Cherry-pick r255832. rdar://problem/61601064
+
+    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.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-05  youenn fablet  <you...@apple.com>
+
+            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-03-30  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r258837. rdar://problem/61064858

Modified: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay-expected.txt (259895 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay-expected.txt	2020-04-10 20:22:18 UTC (rev 259895)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay-expected.txt	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay.html (259895 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay.html	2020-04-10 20:22:18 UTC (rev 259895)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay.html	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1-expected.txt (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1-expected.txt	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1-expected.txt	2020-04-10 20:22:22 UTC (rev 259896)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not start paused video element 
+

Added: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1.html (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay1.html	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2-expected.txt (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2-expected.txt	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2-expected.txt	2020-04-10 20:22:22 UTC (rev 259896)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not start out of DOM video element 
+

Added: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2.html (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay2.html	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3-expected.txt (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3-expected.txt	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3-expected.txt	2020-04-10 20:22:22 UTC (rev 259896)
@@ -0,0 +1,4 @@
+ 
+
+PASS Granting getUserMedia should not pause playing video element 
+

Added: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3.html (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay3.html	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4-expected.txt (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4-expected.txt	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4-expected.txt	2020-04-10 20:22:22 UTC (rev 259896)
@@ -0,0 +1,4 @@
+  
+
+PASS Granting getUserMedia should not start paused media or media that cannot autoplay due to autoplay restrictions 
+

Added: branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4.html (0 => 259896)


--- branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webrtc/video-autoplay4.html	2020-04-10 20:22:22 UTC (rev 259896)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to