webrtc/routines.js should call createAnswer once setRemoteDescription promise is...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 23:08:45 +0000 (23:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 23:08:45 +0000 (23:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173785

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-23
Reviewed by Alex Christensen.

* webrtc/routines.js:

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

LayoutTests/ChangeLog
LayoutTests/webrtc/routines.js

index 0f72316..d801874 100644 (file)
@@ -1,5 +1,14 @@
 2017-06-23  Youenn Fablet  <youenn@apple.com>
 
+        webrtc/routines.js should call createAnswer once setRemoteDescription promise is resolved
+        https://bugs.webkit.org/show_bug.cgi?id=173785
+
+        Reviewed by Alex Christensen.
+
+        * webrtc/routines.js:
+
+2017-06-23  Youenn Fablet  <youenn@apple.com>
+
         webrtc::WebRtcSession is not handling correctly its state when setLocalDescription fails and is called again
         https://bugs.webkit.org/show_bug.cgi?id=173783
 
index abe3920..0b2d76b 100644 (file)
@@ -35,8 +35,9 @@ function gotDescription1(desc, options)
         options.observeOffer(desc);
 
     localConnection.setLocalDescription(desc);
-    remoteConnection.setRemoteDescription(desc);
-    remoteConnection.createAnswer().then((desc) => gotDescription2(desc, options), onCreateSessionDescriptionError);
+    remoteConnection.setRemoteDescription(desc).then(() => {
+        remoteConnection.createAnswer().then((desc) => gotDescription2(desc, options), onCreateSessionDescriptionError);
+    });
 }
 
 function gotDescription2(desc, options)