Modified: trunk/LayoutTests/ChangeLog (215433 => 215434)
--- trunk/LayoutTests/ChangeLog 2017-04-17 21:51:27 UTC (rev 215433)
+++ trunk/LayoutTests/ChangeLog 2017-04-17 22:04:56 UTC (rev 215434)
@@ -1,3 +1,12 @@
+2017-04-17 Youenn Fablet <you...@apple.com>
+
+ LayoutTest webrtc/video-mute.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=170704
+
+ Reviewed by Eric Carlson.
+
+ * webrtc/video-mute.html: Another try at making the test not flaky.
+
2017-04-17 Tim Horton <timothy_hor...@apple.com>
Provide a viewport parameter to disable clipping to the safe area
Modified: trunk/LayoutTests/webrtc/video-mute.html (215433 => 215434)
--- trunk/LayoutTests/webrtc/video-mute.html 2017-04-17 21:51:27 UTC (rev 215433)
+++ trunk/LayoutTests/webrtc/video-mute.html 2017-04-17 22:04:56 UTC (rev 215434)
@@ -7,7 +7,7 @@
<script src=""
</head>
<body>
- <video id="video" autoplay=""></video>
+ <video id="video" autoplay width="640" height="480"></video>
<canvas id="canvas" width="640" height="480"></canvas>
<script src =""
<script>
@@ -30,12 +30,28 @@
return true;
}
+function pollVideoBlackCheck(expected, resolve)
+{
+ if (isVideoBlack() === expected)
+ resolve();
+
+ setTimeout(() => pollVideoBlackCheck(expected, resolve), 50);
+}
+
+function checkVideoBlack(expected, message)
+{
+ return new Promise((resolve, reject) => {
+ pollVideoBlackCheck(expected, resolve);
+ setTimeout(() => reject(message), 5000);
+ });
+}
+
var track;
promise_test((test) => {
if (window.testRunner)
testRunner.setUserMediaPermission(true);
- return navigator.mediaDevices.getUserMedia({ video: true}).then((localStream) => {
+ return navigator.mediaDevices.getUserMedia({ video: {width: 640, height: 480}}).then((localStream) => {
return new Promise((resolve, reject) => {
track = localStream.getVideoTracks()[0];
@@ -50,18 +66,13 @@
video.srcObject = remoteStream;
return video.play();
}).then(() => {
- return waitFor(100);
+ return checkVideoBlack(false, "track is enabled, video should not be black");
}).then(() => {
- assert_false(isVideoBlack(), "track is enabled, video is not black");
- }).then(() => {
track.enabled = false;
- return waitFor(500);
+ return checkVideoBlack(true, "track is disabled, video should be black");
}).then(() => {
- assert_true(isVideoBlack(), "track is disabled, video is black");
track.enabled = true;
- return waitFor(500);
- }).then(() => {
- assert_false(isVideoBlack(), "track is reenabled, video is not black");
+ return checkVideoBlack(false, "track is reenabled, video should not be black");
});
}, "Outgoing muted/unmuted video track");
</script>