mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Trigger connected event for local media connection to self
Also upgrade atom-collaboration-server
This commit is contained in:
@@ -8,6 +8,7 @@ class MediaConnection
|
||||
constructor: (@remoteParticipant) ->
|
||||
if @remoteParticipant.isSelf()
|
||||
@inboundStreamPromise = @createStreamPromise()
|
||||
@inboundStreamPromise.done => @trigger 'connected'
|
||||
else
|
||||
@inboundStreamPromise = $.Deferred()
|
||||
@remoteParticipant.on 'add-ice-candidate', (candidate) =>
|
||||
|
||||
@@ -155,3 +155,29 @@ describe "Collaboration", ->
|
||||
waitsFor "media stream to be established on leader and guest", (stream1Established, stream2Established) ->
|
||||
leaderGuestMediaConnection.getInboundStreamPromise().done(stream1Established)
|
||||
guestLeaderMediaConnection.getInboundStreamPromise().done(stream2Established)
|
||||
|
||||
it "establishes a local media connection for each session participant", ->
|
||||
[leaderSelfMediaConnection, guestSelfMediaConnection] = []
|
||||
|
||||
leaderSession.start()
|
||||
waitsFor "leader session to start", -> leaderStartedHandler.callCount > 0
|
||||
|
||||
runs ->
|
||||
leaderSelfMediaConnection = leaderSession.getSelfParticipant().mediaConnection
|
||||
|
||||
waitsFor "leader self connection to be established", -> leaderSelfMediaConnection.isConnected()
|
||||
|
||||
runs ->
|
||||
token = 'octocat-token'
|
||||
guestSession.start()
|
||||
|
||||
waitsFor "leader to see guest enter", -> leaderParticipantEnteredHandler.callCount > 0
|
||||
|
||||
runs ->
|
||||
guestSelfMediaConnection = guestSession.getSelfParticipant().mediaConnection
|
||||
|
||||
waitsFor "guest self connection to be established", -> guestSelfMediaConnection.isConnected()
|
||||
|
||||
waitsFor "local media streams to be established on leader and guest", (stream1Established, stream2Established) ->
|
||||
leaderSelfMediaConnection.getInboundStreamPromise().done(stream1Established)
|
||||
guestSelfMediaConnection.getInboundStreamPromise().done(stream2Established)
|
||||
|
||||
Reference in New Issue
Block a user