LayoutTest webrtc/datachannel/bufferedAmountLowThreshold.html is a flaky failure
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 22:04:24 +0000 (22:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 22:04:24 +0000 (22:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170701

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-26
Reviewed by Eric Carlson.

* platform/mac-wk1/TestExpectations: Removing flaky expectation.
* webrtc/datachannel/bufferedAmountLowThreshold-expected.txt:
* webrtc/datachannel/bufferedAmountLowThreshold.html:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-expected.txt
LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html

index a5f187e..e555dde 100644 (file)
@@ -1,3 +1,14 @@
+2017-04-26  Youenn Fablet  <youenn@apple.com>
+
+        LayoutTest webrtc/datachannel/bufferedAmountLowThreshold.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=170701
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac-wk1/TestExpectations: Removing flaky expectation.
+        * webrtc/datachannel/bufferedAmountLowThreshold-expected.txt:
+        * webrtc/datachannel/bufferedAmountLowThreshold.html:
+
 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         Restrict WebKit image formats to a known whitelist
index 61c4186..12d1e28 100644 (file)
@@ -96,7 +96,6 @@ http/tests/ssl/media-stream
 imported/w3c/web-platform-tests/webrtc [ Skip ]
 webrtc [ Skip ]
 webrtc/datachannel [ Pass ]
-webrtc/datachannel/bufferedAmountLowThreshold.html [ Failure ]
 webrtc/captureCanvas-webrtc.html [ Pass ]
 
 # These tests test the Shadow DOM based HTML form validation UI but Mac WK1 is using native dialogs instead.
index 646e72e..698bed0 100644 (file)
@@ -1,5 +1,3 @@
-CONSOLE MESSAGE: line 73: channel send is throwing
-CONSOLE MESSAGE: line 73: channel send is throwing
 
 PASS Default buffer threshold 
 PASS Large buffer threshold reached 
index 22d2a02..afc0c74 100644 (file)
@@ -26,26 +26,23 @@ function sendMessages(channel)
 {
     channel.send(longString);
     channel.send(longString);
+    channel.send(longString);
 }
 
 function receiveMessages(event) {
     if (++counter === 1)
         return;
-    finishTest();
 }
 
-var finishTest;
-
 promise_test((test) => {
     counter = 0;
     var gotEvent = false;
     return new Promise((resolve, reject) => {
-        finishTest = resolve;
         createConnections((localConnection) => {
             localChannel = localConnection.createDataChannel('sendDataChannel');
             localChannel.onopen = () => { sendMessages(localChannel); };
             localChannel.onbufferedamountlow = () => {
-                gotEvent = true;
+                resolve();
             }
             assert_equals(localChannel.bufferedAmountLowThreshold, 0, "default bufferedAmountLowThreshold value");
         }, (remoteConnection) => {
@@ -54,11 +51,9 @@ promise_test((test) => {
                 remoteChannel.onmessage = receiveMessages;
             };
         });
-    }).then (() => {
-         return waitFor(500);
+        setTimeout(() => reject('timed out'), 5000);
     }).then (() => {
         closeDataChannels();
-        assert_true(gotEvent, "got onbufferedamountlow event");
     });
 }, "Default buffer threshold");
 
@@ -68,9 +63,8 @@ function sendContinuouslyMessages(channel)
         while (channel.bufferedAmount < 200000)
             channel.send(longString);
 
-       setTimeout(() => sendContinuouslyMessages(channel), 1);
+       setTimeout(() => sendContinuouslyMessages(channel), 0);
     } catch(e) {
-        console.log("channel send is throwing");
     }
 }
 
@@ -78,13 +72,12 @@ promise_test((test) => {
     counter = 0;
     var gotEvent = false;
     return new Promise((resolve, reject) => {
-        finishTest = resolve;
         createConnections((localConnection) => {
             localChannel = localConnection.createDataChannel('sendDataChannel');
             localChannel.onopen = () => {
                 sendContinuouslyMessages(localChannel);
                 localChannel.onbufferedamountlow = () => {
-                    gotEvent = true;
+                    resolve();
                 }
             };
             localChannel.bufferedAmountLowThreshold = 200000;
@@ -94,11 +87,9 @@ promise_test((test) => {
                 remoteChannel.onmessage = receiveMessages;
             };
         });
-    }).then (() => {
-         return waitFor(500);
+        setTimeout(() => reject('timed out'), 5000);
     }).then (() => {
         closeDataChannels();
-        assert_true(gotEvent, "got onbufferedamountlow event");
     });
 }, "Large buffer threshold reached");
 
@@ -106,27 +97,24 @@ promise_test((test) => {
     counter = 0;
     var gotEvent = false;
     return new Promise((resolve, reject) => {
-        finishTest = resolve;
         createConnections((localConnection) => {
             localChannel = localConnection.createDataChannel('sendDataChannel');
             localChannel.onopen = () => {
                 sendContinuouslyMessages(localChannel);
                 localChannel.onbufferedamountlow = () => {
-                    gotEvent = true;
+                    reject();
                 }
             };
-            localChannel.bufferedAmountLowThreshold = 100000;
+            localChannel.bufferedAmountLowThreshold = 10;
         }, (remoteConnection) => {
             remoteConnection.ondatachannel = (event) => {
                 remoteChannel = event.channel;
                 remoteChannel.onmessage = receiveMessages;
             };
         });
-    }).then (() => {
-         return waitFor(500);
+        setTimeout(resolve, 50);
     }).then (() => {
         closeDataChannels();
-        assert_false(gotEvent, "got onbufferedamountlow event");
     });
 }, "Medium buffer threshold not reached");
     </script>