Title: [218726] trunk/LayoutTests
Revision
218726
Author
[email protected]
Date
2017-06-22 15:49:41 -0700 (Thu, 22 Jun 2017)

Log Message

Add a test for multi data channel peer connection
https://bugs.webkit.org/show_bug.cgi?id=173735

Patch by Youenn Fablet <[email protected]> on 2017-06-22
Reviewed by Eric Carlson.

* webrtc/datachannel/multi-channel-expected.txt: Added.
* webrtc/datachannel/multi-channel.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (218725 => 218726)


--- trunk/LayoutTests/ChangeLog	2017-06-22 22:47:00 UTC (rev 218725)
+++ trunk/LayoutTests/ChangeLog	2017-06-22 22:49:41 UTC (rev 218726)
@@ -1,3 +1,13 @@
+2017-06-22  Youenn Fablet  <[email protected]>
+
+        Add a test for multi data channel peer connection
+        https://bugs.webkit.org/show_bug.cgi?id=173735
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/datachannel/multi-channel-expected.txt: Added.
+        * webrtc/datachannel/multi-channel.html: Added.
+
 2017-06-22  Antoine Quint  <[email protected]>
 
         REGRESSION: LayoutTest media/modern-media-controls/placard-support/placard-support-pip.html is a flaky timeout on Sierra

Added: trunk/LayoutTests/webrtc/datachannel/multi-channel-expected.txt (0 => 218726)


--- trunk/LayoutTests/webrtc/datachannel/multi-channel-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/multi-channel-expected.txt	2017-06-22 22:49:41 UTC (rev 218726)
@@ -0,0 +1,3 @@
+
+PASS Using two data channels in the same peer connection 
+

Added: trunk/LayoutTests/webrtc/datachannel/multi-channel.html (0 => 218726)


--- trunk/LayoutTests/webrtc/datachannel/multi-channel.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/multi-channel.html	2017-06-22 22:49:41 UTC (rev 218726)
@@ -0,0 +1,51 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Testing two data channels in the same peer connection</title>
+    <script src=""
+    <script src=""
+  </head>
+  <body>
+    <script src =""
+    <script>
+var counter = 0;
+function receiveMessages(event) {
+    if (++counter === 4)
+        finishTest();
+}
+
+function sendMessages1(channel)
+{
+    channel.send("one");
+    channel.send("two");
+}
+
+function sendMessages2(channel)
+{
+    channel.send("three");
+    channel.send("four");
+}
+
+var finishTest;
+promise_test((test) => {
+    counter = 0;
+    return new Promise((resolve, reject) => {
+        finishTest = resolve;
+        createConnections((localConnection) => {
+            var localChannel1 = localConnection.createDataChannel('channel1');
+            var localChannel2 = localConnection.createDataChannel('channel2');
+            localChannel1._onopen_ = () => { sendMessages1(localChannel1); };
+            localChannel2._onopen_ = () => { sendMessages2(localChannel2); };
+        }, (remoteConnection) => {
+            remoteConnection._ondatachannel_ = (event) => {
+                event.channel._onmessage_ = receiveMessages;
+            };
+        });
+        setTimeout(() => { reject("Test timed out"); }, 5000);
+    });
+}, "Using two data channels in the same peer connection");
+
+    </script>
+  </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to