haikuwebkit/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt

81 lines
5.2 KiB
Plaintext
Raw Permalink Normal View History

MediaStream API: Introduce RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=93117 Reviewed by Adam Barth. Source/WebCore: This patch introduces RTCIceCandidate together with its corresponding WebCore/platform representation. Test: fast/mediastream/RTCIceCandidate.html * CMakeLists.txt: * GNUmakefile.list.am: * Modules/mediastream/DOMWindowMediaStream.idl: * Modules/mediastream/RTCIceCandidate.cpp: Added. (WebCore): (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): (WebCore::RTCIceCandidate::~RTCIceCandidate): (WebCore::RTCIceCandidate::candidate): (WebCore::RTCIceCandidate::sdpMid): (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::descriptor): * Modules/mediastream/RTCIceCandidate.h: Added. (WebCore): (RTCIceCandidate): * Modules/mediastream/RTCIceCandidate.idl: Added. * WebCore.gypi: * platform/mediastream/RTCIceCandidateDescriptor.cpp: Added. (WebCore): (WebCore::RTCIceCandidateDescriptor::create): (WebCore::RTCIceCandidateDescriptor::RTCIceCandidateDescriptor): (WebCore::RTCIceCandidateDescriptor::~RTCIceCandidateDescriptor): * platform/mediastream/RTCIceCandidateDescriptor.h: Added. (WebCore): (RTCIceCandidateDescriptor): (WebCore::RTCIceCandidateDescriptor::candidate): (WebCore::RTCIceCandidateDescriptor::sdpMid): (WebCore::RTCIceCandidateDescriptor::sdpMLineIndex): LayoutTests: * fast/mediastream/RTCIceCandidate-expected.txt: Added. * fast/mediastream/RTCIceCandidate.html: Added. Canonical link: https://commits.webkit.org/112560@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-22 19:18:34 +00:00
Tests RTCIceCandidate.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS candidate = new RTCIceCandidate(initializer); did not throw exception.
PASS candidate.candidate is "foo"
PASS candidate.sdpMid is "bar"
PASS candidate.sdpMLineIndex is 6
Add WebIDL special operation support: serializer https://bugs.webkit.org/show_bug.cgi?id=156293 Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-28 Reviewed by Youenn Fablet. Source/WebCore: Added support for the serializer special operation for WebIDLs, current implementation adds support for: - just the keyword: serializer; It will return all the attributes of in an object. - map of entries with the attributes: serializer = {attribute1, attribute2, ...} It creates a toJSON method that returns the serialized value converted into an ECMAScript value. For more information check the definition of the operation: http://heycam.github.io/webidl/#idl-serializers We have created a new function in the API of the objects that are marked as serializer. Used the support to add new API for RTCIceCandidate and RTCSessionDescription. Updated the tests expectations of the bindings. Tests: bindings/scripts/test/TestNode.idl bindings/scripts/test/TestObj.idl fast/mediastream/RTCIceCandidate.html fast/mediastream/RTCSessionDescription.html * Modules/mediastream/RTCIceCandidate.idl: Added the serializer operation. * Modules/mediastream/RTCSessionDescription.idl: Added the serializer operation. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Added the calls to the serializer code generator. (GenerateSerializerFunction): Added, generates the toJSON function adding all the serializable->attributes value to an object as defined in the spec. * bindings/scripts/IDLParser.pm: Modified the serializer parser that was unused to support the WebIDL spec parts. Added a new domSerializable type to store the list of attributes in the possible map. (parseSerializer): Modified the function to follow the semicolon rule in the spec, now the serializer line must have a semicolon like any other line. (parseSerializerRest): The function now has to get the attributes list from the pattern parsing function and add them to the domSerializable item. (parseSerializationPattern): Now this function returns the list of attributes in the serializable map or list if we have one. (parseSerializationAttributes): Added, this function replaces the Map and List functions, the currently supported parts are similar for both situations. (applyMemberList): Added the serializable item to the interface variable and populate the serializable in case there is not a defined map. (parseSerializationPatternMap): Replaced with parseSerializationAttributes. (parseSerializationPatternList): Ditto. * bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result. (WebCore::jsTestNodePrototypeFunctionToJSON): * bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result. (WebCore::jsTestObjPrototypeFunctionToJSON): * bindings/scripts/test/TestNode.idl: Added the serializer test. * bindings/scripts/test/TestObj.idl: Added serializer map test. LayoutTests: Verify the new API of the objects and check what happens when user modifies the values and types of the attributes, or adds a null value. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: * fast/mediastream/RTCSessionDescription-expected.txt: * fast/mediastream/RTCSessionDescription.html: Canonical link: https://commits.webkit.org/180612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-09-28 13:18:37 +00:00
PASS RTCIceCandidate.prototype.toJSON is defined.
PASS Object.getOwnPropertyDescriptor(RTCIceCandidate.prototype, "toJSON").enumerable is true
PASS Object.getOwnPropertyDescriptor(RTCIceCandidate.prototype, "toJSON").writable is true
PASS Object.getOwnPropertyDescriptor(RTCIceCandidate.prototype, "toJSON").configurable is true
PASS RTCIceCandidate.prototype.toJSON.length is 0
PASS RTCIceCandidate.prototype.toJSON.name is "toJSON"
PASS Object.getOwnPropertyDescriptor(jsonMap, "candidate").enumerable is true
PASS Object.getOwnPropertyDescriptor(jsonMap, "candidate").writable is true
PASS Object.getOwnPropertyDescriptor(jsonMap, "candidate").configurable is true
PASS childCandidate.toJSON(); threw exception TypeError: Can only call RTCIceCandidate.toJSON on instances of RTCIceCandidate.
[WebIDL] Replace 'serializable' with '[Default] object toJSON()' https://bugs.webkit.org/show_bug.cgi?id=216148 LayoutTests/imported/w3c: <rdar://problem/68668407> Reviewed by Eric Carlson. Update results to account for now correctly returning DOMPoints, rather than vanilla Objects, for the points in a DOMQuad when using toJSON. * web-platform-tests/css/geometry/idlharness-expected.txt: * web-platform-tests/css/geometry/idlharness.worker-expected.txt: Source/WebCore: Reviewed by Eric Carlson. Replace the 'serializable' keyword, which has been removed from WebIDL, with its replacement, '[Default] object toJSON()'. The new version is pretty similar, but has much less room for customization in that you can no longer specify which attributes are included in the JSON result. Rather, all attributes that qualify as having a 'JSON type' are included for the interface itself and all ancestor interfaces. Interfaces that need more control can provide their own toJSON operation with the [Default] extended attribute. This updates all the IDLs that used serializer to use the new [Default] except RTCIceCandidate.idl, which is specified to have a custom toJSON that returns a RTCIceCandidateInit, so that was implemented instead. * css/DOMMatrixReadOnly.idl: * dom/DOMPointReadOnly.idl: * dom/DOMQuad.idl: * dom/DOMRectReadOnly.idl: * page/PerformanceEntry.idl: * page/PerformanceResourceTiming.h: * page/PerformanceResourceTiming.idl: * page/PerformanceServerTiming.idl: * page/PerformanceTiming.idl: * Modules/mediastream/MediaDeviceInfo.idl: * Modules/mediastream/RTCIceCandidate.cpp: * Modules/mediastream/RTCIceCandidate.h: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/paymentrequest/PaymentAddress.idl: * Modules/paymentrequest/PaymentResponse.idl: Update IDLs replacing all use of serializer. * bindings/scripts/CodeGenerator.pm: (InterfaceHasRegularToJSONOperation): (IsJSONType): (InheritsSerializable): Deleted. (IsSerializableType): Deleted. (IsSerializableAttribute): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (PrototypeOperationCount): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateOperationDefinition): (GenerateDefaultOperationDefinition): (GenerateDefaultToJSONOperationDefinition): (GetRuntimeEnabledStaticProperties): (GenerateSerializerDefinition): Deleted. * bindings/scripts/IDLParser.pm: (cloneOperation): (parsePartialInterfaceMember): (applyMemberList): (parseSerializer): Deleted. (parseSerializerRest): Deleted. (parseSerializationPattern): Deleted. (parseSerializationAttributes): Deleted. * bindings/scripts/IDLAttributes.json: Add support for [Default] toJSON and remove support for serializer. * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: Added. * bindings/scripts/test/JS/JSTestDefaultToJSON.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestSerialization.cpp: Removed. * bindings/scripts/test/JS/JSTestSerialization.h: Removed. * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Removed. * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationInherit.h: Removed. * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestDefaultToJSON.idl: Added. * bindings/scripts/test/TestDefaultToJSONIndirectInheritance.idl: Added. * bindings/scripts/test/TestDefaultToJSONInherit.idl: Added. * bindings/scripts/test/TestDefaultToJSONInheritFinal.idl: Added. * bindings/scripts/test/TestNode.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestSerialization.idl: Removed. * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Removed. * bindings/scripts/test/TestSerializationInherit.idl: Removed. * bindings/scripts/test/TestSerializationInheritFinal.idl: Removed. Update tests. LayoutTests: <rdar://problem/68668407> Reviewed by Eric Carlson. Update test and results to account for RTCIceCandidate.toJSON() now returning RTCIceCandidateInit. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: Canonical link: https://commits.webkit.org/229310@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-14 17:21:50 +00:00
PASS JSON.stringify(candidate.toJSON()) is "{\"candidate\":\"foo\",\"sdpMLineIndex\":6,\"sdpMid\":\"bar\",\"usernameFragment\":null}"
PASS JSON.stringify(candidate.toJSON()) is "{\"candidate\":\"foo\",\"sdpMLineIndex\":6,\"sdpMid\":\"bar\",\"usernameFragment\":null}"
PASS JSON.stringify(candidate.toJSON()) is "{\"candidate\":\"foo\",\"sdpMLineIndex\":6,\"sdpMid\":\"bar\",\"usernameFragment\":null}"
PASS JSON.stringify(candidate.toJSON()) is "{\"candidate\":\"foo\",\"sdpMLineIndex\":6,\"sdpMid\":\"bar\",\"usernameFragment\":null}"
PASS JSON.stringify(candidate.toJSON()) is "{\"candidate\":\"foo\",\"sdpMLineIndex\":6,\"sdpMid\":\"bar\",\"usernameFragment\":null}"
WebRTC: Update RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=155535 Reviewed by Eric Carlson. Source/WebCore: Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1]. In short: The "candidate" init dictionary member is required. At least one of the dictionary members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the other, is initialized to null. [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html Tests: Updated fast/mediastream/RTCIceCandidate.htm * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): * Modules/mediastream/RTCIceCandidate.h: (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::setSdpMLineIndex): * Modules/mediastream/RTCIceCandidate.idl: * bindings/js/JSRTCIceCandidateCustom.cpp: (WebCore::JSRTCIceCandidate::sdpMid): (WebCore::JSRTCIceCandidate::sdpMLineIndex): LayoutTests: RTCIceCandidate.html is updated to test the new construction behavior and the nullable attributes. The remaining updated tests simply construct an RTCIceCandidate to be used for test purposes. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: * fast/mediastream/RTCPeerConnection-closed-state.html: * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Canonical link: https://commits.webkit.org/173694@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 10:52:20 +00:00
Attributes are readonly
candidate.candidate = "foo-updated"
PASS candidate.candidate is "foo"
candidate.sdpMid = "bar-updated"
PASS candidate.sdpMid is "bar"
candidate.sdpMLineIndex = 7
PASS candidate.sdpMLineIndex is 6
Dictionary argument is mandatory.
PASS new RTCIceCandidate(); threw exception TypeError: Not enough arguments.
One of the 'sdpMid' or 'sdpMLineIndex' members must be present (and not null or undefined).
Introduce a C++ chain of operations in RTCPeerConnection https://bugs.webkit.org/show_bug.cgi?id=216006 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-timing.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-track-stats.https-expected.txt: * web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt: * web-platform-tests/webrtc/idlharness.https.window-expected.txt: Source/WebCore: Remove RTCPeerConnection JS built-ins and introduce a C++ version. This allows to make replaceTrack part of the chain of operation. Also update setLocalDescription to take no parameters. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::createOfferSucceeded): (WebCore::PeerConnectionBackend::createAnswerSucceeded): (WebCore::PeerConnectionBackend::setLocalDescription): (WebCore::PeerConnectionBackend::setRemoteDescription): (WebCore::PeerConnectionBackend::transceiverFromSender): Deleted. * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): * Modules/mediastream/RTCIceCandidate.h: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::removeTrack): (WebCore::RTCPeerConnection::createOffer): (WebCore::RTCPeerConnection::createAnswer): (WebCore::RTCPeerConnection::setLocalDescription): (WebCore::RTCPeerConnection::setRemoteDescription): (WebCore::RTCPeerConnection::addIceCandidate): (WebCore::RTCPeerConnection::getStats): (WebCore::RTCPeerConnection::doClose): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): (WebCore::RTCPeerConnection::chainOperation): (WebCore::RTCPeerConnection::initializeWith): Deleted. (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted. (WebCore::RTCPeerConnection::queuedCreateAnswer): Deleted. (WebCore::RTCPeerConnection::queuedSetLocalDescription): Deleted. (WebCore::RTCPeerConnection::queuedSetRemoteDescription): Deleted. (WebCore::RTCPeerConnection::queuedAddIceCandidate): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnection.js: Removed. * Modules/mediastream/RTCPeerConnectionInternals.js: Removed. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::RTCRtpSender): (WebCore::RTCRtpSender::replaceTrack): (WebCore::RTCRtpSender::isCreatedBy const): (WebCore::RTCRtpSender::dtmf): (WebCore::RTCRtpSender::currentTransceiverDirection const): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/RTCSessionDescription.cpp: (WebCore::RTCSessionDescription::create): * Modules/mediastream/RTCSessionDescription.h: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription): (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind): (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: LayoutTests: * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt: * fast/mediastream/RTCPeerConnection-media-setup-single-dialog-expected.txt: * fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid-expected.txt: * webrtc/libwebrtc/release-while-creating-offer-expected.txt: * webrtc/remove-track-expected.txt: * webrtc/remove-track.html: Make sure we are in a stable state before going to removeTrack actual test. Also make sure to call setRemoteDescription for second test. Canonical link: https://commits.webkit.org/228873@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-02 16:19:52 +00:00
PASS new RTCIceCandidate({candidate:"foo"}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMid: null}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMid: undefined}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMLineIndex: null}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMLineIndex: undefined}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: null}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
PASS new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: undefined}); threw exception TypeError: Candidate must not have both null sdpMid and sdpMLineIndex.
Test that sdpMid or sdpMLineIndex explicitly set to null or undefined, results in a null value.
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: null, sdpMLineIndex: 1}); did not throw exception.
PASS candidate.sdpMid is null
PASS candidate.sdpMLineIndex is 1
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: undefined, sdpMLineIndex: 1}); did not throw exception.
PASS candidate.sdpMid is null
PASS candidate.sdpMLineIndex is 1
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: null}); did not throw exception.
PASS candidate.sdpMid is 'foo'
PASS candidate.sdpMLineIndex is null
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid: "foo", sdpMLineIndex: undefined}); did not throw exception.
PASS candidate.sdpMid is 'foo'
PASS candidate.sdpMLineIndex is null
WebRTC: Update RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=155535 Reviewed by Eric Carlson. Source/WebCore: Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1]. In short: The "candidate" init dictionary member is required. At least one of the dictionary members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the other, is initialized to null. [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html Tests: Updated fast/mediastream/RTCIceCandidate.htm * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): * Modules/mediastream/RTCIceCandidate.h: (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::setSdpMLineIndex): * Modules/mediastream/RTCIceCandidate.idl: * bindings/js/JSRTCIceCandidateCustom.cpp: (WebCore::JSRTCIceCandidate::sdpMid): (WebCore::JSRTCIceCandidate::sdpMLineIndex): LayoutTests: RTCIceCandidate.html is updated to test the new construction behavior and the nullable attributes. The remaining updated tests simply construct an RTCIceCandidate to be used for test purposes. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: * fast/mediastream/RTCPeerConnection-closed-state.html: * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Canonical link: https://commits.webkit.org/173694@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 10:52:20 +00:00
When one of the 'sdpMid' or 'sdpMLineIndex' members is set, the other must be null.
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMid:"bar"}); did not throw exception.
PASS candidate.sdpMid is "bar"
PASS candidate.sdpMLineIndex is null
PASS candidate = new RTCIceCandidate({candidate:"foo", sdpMLineIndex:6}); did not throw exception.
PASS candidate.sdpMid is null
PASS candidate.sdpMLineIndex is 6
Remove uses of Dictionary in WebRTC IDL files https://bugs.webkit.org/show_bug.cgi?id=165736 Reviewed by Sam Weinig. Source/WebCore: Also removed quite a bit of unused code. There were some mocks that were out of date and no longer matched the types used in the real code, that also were no longer hooked up, and other types of dead code. We will have to implement anew when we want to restore tests like the ones these were intended to enable. * CMakeLists.txt: Updated for all the removed files. * Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here that don't need to be in the header. (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique. (WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type, obviating the need for most of the code that was here. * Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more things private and final. Marked the constructor explicit. Removed unneeded includes. * Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward declarations. Changed the argument type for setConfiguration (see above). * Modules/mediastream/RTCConfiguration.cpp: Removed. None of the code here was needed except for the ICE server validation, and that was moved into RTCPeerConnection::setConfiguration. * Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since this is now a dictionary rather than an interface. * Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary. * Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed some of the dead code. Someone will have to straighten this out so we can turn it back on. * Modules/mediastream/RTCDTMFSender.h: Ditto. * Modules/mediastream/RTCDataChannel.cpp: Updated includes. * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes a structure rather than a WebCore::Dictionary, and so the bindings take care of the work. * Modules/mediastream/RTCIceCandidate.h: Updated for the above. * Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a RTCIceCandidateInit instead of a Dictionary. * Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since this is now a dictionary rather than an interface. * Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than a Dictionary. (WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline. (WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead of the configuration class. Also moved validation of server URLs here, formerly in the RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from RTCConfiguration to MediaEndpointConfiguration here, formerly in MediaEndpointPeerConnection::setConfiguration. * Modules/mediastream/RTCPeerConnection.h: Updated for the above. * Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and setConfiguration from Dictionary to RTCConfiguration. * Modules/mediastream/RTCSessionDescription.cpp: (WebCore::parseTypeString): Deleted. (WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary. * Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to take it. * Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take RTCSessionDescriptionInit dictionary instead of Dictionary. * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes. * WebCore.xcodeproj/project.pbxproj: Updated for all the removed files. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDictionaryImplementationContent): Fixed convertDictionaryToJS to work with other nullable types besides RefPtr. * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated. * platform/mediastream/RTCConfigurationPrivate.h: Removed. * platform/mediastream/RTCIceServerPrivate.h: Removed. * platform/mediastream/RTCPeerConnectionHandler.cpp: Removed. * platform/mediastream/RTCPeerConnectionHandler.h: Removed. * platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed. * platform/mock/RTCDTMFSenderHandlerMock.h: Removed. * platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final. * platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed. * platform/mock/RTCPeerConnectionHandlerMock.h: Removed. * testing/Internals.cpp: (WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler. (WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted. LayoutTests: * fast/mediastream/RTCIceCandidate-expected.txt: Regenerated; no new failures. * fast/mediastream/RTCIceCandidate.html: Updated test to expect the WebIDL rules for parsing unsigned short for sdpMLineIndex. The old code expected additional range checking which is not expected behavior. * fast/mediastream/RTCPeerConnection-expected.txt: Regenerated; no new failures. * fast/mediastream/RTCPeerConnection.html: Updated test to not expect an exception when iceServers is entirely omitted or when it is an empty array. This is a progression and is closer to the specification. * fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: Regenerated; no new failures. * fast/mediastream/RTCPeerConnection-getConfiguration.html: Updated test to expect the username and credential fields to round trip as missing rather than turning from missing into empty strings. Also updated the tests to pass in sequences of strings for "urls" since they expect sequences on the way back out. We could also test round tripping of single strings, which should go in and come back out as individual strings, but for now I did not bother adding that to this test. * fast/mediastream/RTCSessionDescription-expected.txt: Regenerated; some exception messages are now more specific than they were before. * imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt: Updated expected results. The new code correctly allows callers of the RTCPeerConnection constructor to omit iceServers, pass undefined, or pass an empty array, as specified. Thuis change leads to a couple tests that now correctly pass instead of failing. And it also leads to some other tests failing that were passing before. These were passing because they expected an exception for some other reason, however the exception was actually occurring because of incorrect handling of iceServers. Canonical link: https://commits.webkit.org/183351@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-12 02:50:06 +00:00
Conversion of sdpMLineIndex to unsigned short, following WebIDL rules without [Clamp] or [EnforceRange]
PASS (new RTCIceCandidate({candidate:"foo", sdpMLineIndex:"a"})).sdpMLineIndex is 0
PASS (new RTCIceCandidate({candidate:"foo", sdpMLineIndex:-1})).sdpMLineIndex is 65535
PASS (new RTCIceCandidate({candidate:"foo", sdpMLineIndex:65536})).sdpMLineIndex is 0
PASS (new RTCIceCandidate({candidate:"foo", sdpMLineIndex:65537})).sdpMLineIndex is 1
WebRTC: Update RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=155535 Reviewed by Eric Carlson. Source/WebCore: Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1]. In short: The "candidate" init dictionary member is required. At least one of the dictionary members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the other, is initialized to null. [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html Tests: Updated fast/mediastream/RTCIceCandidate.htm * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): * Modules/mediastream/RTCIceCandidate.h: (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::setSdpMLineIndex): * Modules/mediastream/RTCIceCandidate.idl: * bindings/js/JSRTCIceCandidateCustom.cpp: (WebCore::JSRTCIceCandidate::sdpMid): (WebCore::JSRTCIceCandidate::sdpMLineIndex): LayoutTests: RTCIceCandidate.html is updated to test the new construction behavior and the nullable attributes. The remaining updated tests simply construct an RTCIceCandidate to be used for test purposes. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: * fast/mediastream/RTCPeerConnection-closed-state.html: * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Canonical link: https://commits.webkit.org/173694@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 10:52:20 +00:00
Some bad input
PASS new RTCIceCandidate(5); threw exception TypeError: Type error.
PASS new RTCIceCandidate("foobar"); threw exception TypeError: Type error.
PASS new RTCIceCandidate(candidate:""); threw exception SyntaxError: Unexpected token ':'. Expected ')' to end an argument list..
MediaStream API: Introduce RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=93117 Reviewed by Adam Barth. Source/WebCore: This patch introduces RTCIceCandidate together with its corresponding WebCore/platform representation. Test: fast/mediastream/RTCIceCandidate.html * CMakeLists.txt: * GNUmakefile.list.am: * Modules/mediastream/DOMWindowMediaStream.idl: * Modules/mediastream/RTCIceCandidate.cpp: Added. (WebCore): (WebCore::RTCIceCandidate::create): (WebCore::RTCIceCandidate::RTCIceCandidate): (WebCore::RTCIceCandidate::~RTCIceCandidate): (WebCore::RTCIceCandidate::candidate): (WebCore::RTCIceCandidate::sdpMid): (WebCore::RTCIceCandidate::sdpMLineIndex): (WebCore::RTCIceCandidate::descriptor): * Modules/mediastream/RTCIceCandidate.h: Added. (WebCore): (RTCIceCandidate): * Modules/mediastream/RTCIceCandidate.idl: Added. * WebCore.gypi: * platform/mediastream/RTCIceCandidateDescriptor.cpp: Added. (WebCore): (WebCore::RTCIceCandidateDescriptor::create): (WebCore::RTCIceCandidateDescriptor::RTCIceCandidateDescriptor): (WebCore::RTCIceCandidateDescriptor::~RTCIceCandidateDescriptor): * platform/mediastream/RTCIceCandidateDescriptor.h: Added. (WebCore): (RTCIceCandidateDescriptor): (WebCore::RTCIceCandidateDescriptor::candidate): (WebCore::RTCIceCandidateDescriptor::sdpMid): (WebCore::RTCIceCandidateDescriptor::sdpMLineIndex): LayoutTests: * fast/mediastream/RTCIceCandidate-expected.txt: Added. * fast/mediastream/RTCIceCandidate.html: Added. Canonical link: https://commits.webkit.org/112560@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-22 19:18:34 +00:00
PASS successfullyParsed is true
TEST COMPLETE