Closed
Bug 1075133
Opened 10 years ago
Closed 10 years ago
onsignalingstatechange is not fired as an event
Categories
(Core :: WebRTC, defect)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: bwc, Assigned: jib)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
12.20 KB,
patch
|
jib
:
review+
|
Details | Diff | Splinter Review |
onsignalingstatechange is passed the signaling state, and not an Event as required by the specification. Additionally, the mochitests expect this non-standard behavior.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee: docfaraday → jib
Status: NEW → ASSIGNED
Attachment #8523372 -
Flags: review?(drno)
Attachment #8523372 -
Flags: review?(docfaraday)
Reporter | ||
Comment 2•10 years ago
|
||
Comment on attachment 8523372 [details] [diff] [review]
fire onsignalingstatechange as an event
Review of attachment 8523372 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/tests/mochitest/test_peerConnection_close.html
@@ +104,2 @@
>
> + finished.then(networkTestFinished);
So this is where |finish| is set? I would expect the signalingstatechange event to fire before we get down here. Wouldn't that mean |finish| isn't set yet when we call it?
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Byron Campen [:bwc] from comment #2)
> > + finished.then(networkTestFinished);
>
> So this is where |finish| is set? I would expect the signalingstatechange
> event to fire before we get down here. Wouldn't that mean |finish| isn't set
> yet when we call it?
|finish| is the resolve-function of the promise |finished|. [1]
The promise is "fulfilled" when finish() is called, either by the onsignalingstate function or the timer function, whichever happen first (subsequent calls are ignored).
Promises can be subscribed to (with .then()) before or after they’ve been fulfilled [2] so there's no timing issue. If the promise has already been fulfilled, then the then-function is called immediately, otherwise it gets queued and called later when the promise is eventually fulfilled.
[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-constructor
[1] http://www.w3.org/2001/tag/doc/promises-guide#one-time-events
Reporter | ||
Comment 4•10 years ago
|
||
Comment on attachment 8523372 [details] [diff] [review]
fire onsignalingstatechange as an event
Review of attachment 8523372 [details] [diff] [review]:
-----------------------------------------------------------------
Ok, so the function you pass the Promise is executed immediately. Got it.
Attachment #8523372 -
Flags: review?(docfaraday) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Right. I think they did that to encourage scoping of the execution to be inside the constructor, which of course I violate here (to be fair: for the sake of hg blame).
Comment 6•10 years ago
|
||
Comment on attachment 8523372 [details] [diff] [review]
fire onsignalingstatechange as an event
Review of attachment 8523372 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM assuming we add the event verification back in.
::: dom/media/tests/mochitest/test_peerConnection_close.html
@@ +33,1 @@
> clearTimeout(eTimeout);
You deleted the event verification itself here. I think it would be good to keep that verification.
Attachment #8523372 -
Flags: review?(drno) → review+
Assignee | ||
Comment 7•10 years ago
|
||
Updated commit msg.
(In reply to Nils Ohlmeier [:drno] from comment #6)
> LGTM assuming we add the event verification back in.
Agreed on irc that no verification is needed since event is just Event.
Attachment #8523372 -
Attachment is obsolete: true
Attachment #8526374 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Keywords: checkin-needed
Comment 9•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 10•10 years ago
|
||
Not sure which are the right key words here, but this change should get documented somewhere.
Keywords: APIchange,
dev-doc-needed
Comment 11•10 years ago
|
||
I've added a note here:
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection.onsignalingstatechange
and in
https://developer.mozilla.org/en-US/Firefox/Releases/36#Interfaces.2FAPIs.2FDOM
You need to log in
before you can comment on or make changes to this bug.
Description
•