Bug 170118 - addIceCandidate should not throw if passed null or undefined
Summary: addIceCandidate should not throw if passed null or undefined
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on: 170192
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-27 08:12 PDT by youenn fablet
Modified: 2017-03-28 12:56 PDT (History)
6 users (show)

See Also:


Attachments
Patch (12.61 KB, patch)
2017-03-27 09:17 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (937.60 KB, application/zip)
2017-03-27 10:26 PDT, Build Bot
no flags Details
Patch (15.13 KB, patch)
2017-03-27 11:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-03-27 08:12:43 PDT
This should just indicate end of ICE candidate addition.
Comment 1 youenn fablet 2017-03-27 09:17:47 PDT
Created attachment 305475 [details]
Patch
Comment 2 Build Bot 2017-03-27 10:26:42 PDT
Comment on attachment 305475 [details]
Patch

Attachment 305475 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3418452

New failing tests:
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
webrtc/video-remote-mute.html
webrtc/audio-replace-track.html
webrtc/release-after-getting-track.html
webrtc/video-replace-track-to-null.html
webrtc/audio-peer-connection-webaudio.html
webrtc/peer-connection-audio-mute.html
webrtc/video-mediastreamtrack-stats.html
webrtc/video-with-receiver.html
webrtc/video-mute.html
webrtc/connection-state.html
Comment 3 Build Bot 2017-03-27 10:26:45 PDT
Created attachment 305479 [details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 4 youenn fablet 2017-03-27 11:01:06 PDT
Created attachment 305485 [details]
Patch
Comment 5 Eric Carlson 2017-03-27 16:08:14 PDT
Comment on attachment 305485 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=305485&action=review

> LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:82
> +FAIL RTCPeerConnection interface: calling addIceCandidate([object Object],[object Object]) on pc with too few arguments must throw TypeError assert_unreached: Should have rejected: undefined Reached unreachable code

is this expected?
Comment 6 youenn fablet 2017-03-27 16:22:23 PDT
(In reply to Eric Carlson from comment #5)
> Comment on attachment 305485 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=305485&action=review
> 
> > LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:82
> > +FAIL RTCPeerConnection interface: calling addIceCandidate([object Object],[object Object]) on pc with too few arguments must throw TypeError assert_unreached: Should have rejected: undefined Reached unreachable code
> 
> is this expected?

I think webidl parser should be updated and/or the test so that it understands that undefined turns into an empty RTCIceCandidateInit object.
Comment 7 WebKit Commit Bot 2017-03-27 16:36:40 PDT
Comment on attachment 305485 [details]
Patch

Clearing flags on attachment: 305485

Committed r214441: <http://trac.webkit.org/changeset/214441>
Comment 8 WebKit Commit Bot 2017-03-27 16:36:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Chris Dumez 2017-03-27 16:48:36 PDT
Comment on attachment 305485 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=305485&action=review

>>> LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:82
>>> +FAIL RTCPeerConnection interface: calling addIceCandidate([object Object],[object Object]) on pc with too few arguments must throw TypeError assert_unreached: Should have rejected: undefined Reached unreachable code
>> 
>> is this expected?
> 
> I think webidl parser should be updated and/or the test so that it understands that undefined turns into an empty RTCIceCandidateInit object.

This one looks real to me. You are no longer throwing a TypeError when calling addIceCandidate() without a parameter. As per Web IDL, I think we should. addIceCandidate(undefined) is not the same as addIceCandidate().
Comment 10 youenn fablet 2017-03-27 16:58:31 PDT
Filed bug 170146 to fix both not-throwing and function-length failures