Changeset 281985 in webkit


Ignore:
Timestamp:
Sep 3, 2021 4:30:15 AM (11 months ago)
Author:
youenn@apple.com
Message:

Signaling state check when applying a local or remote description is no longer aligned with the WebRTC spec
https://bugs.webkit.org/show_bug.cgi?id=229138

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebasing tests.
Some tests are going from PASS to FAIL:

  • LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https.html: we do not support yet rollback.
  • LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html: is no longer throwing the right exception (and we are not supporting pranswer yet).
  • LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html: we are throwing with a different exception.
  • web-platform-tests/webrtc/RTCPeerConnection-SLD-SRD-timing.https-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-restartIce.https-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-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-pranswer-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback-expected.txt:
  • web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:

Source/WebCore:

These checks have been removed from the spec and are no longer valid.
Covered by rebased tests.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::setLocalDescription):
(WebCore::PeerConnectionBackend::setRemoteDescription):
(WebCore::isLocalDescriptionTypeValidForState): Deleted.
(WebCore::isRemoteDescriptionTypeValidForState): Deleted.

  • testing/MockLibWebRTCPeerConnection.cpp:

(WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):

  • testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

  • fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
  • fast/mediastream/RTCPeerConnection-stable-expected.txt:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r281981 r281985  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Signaling state check when applying a local or remote description is no longer aligned with the WebRTC spec
     4        https://bugs.webkit.org/show_bug.cgi?id=229138
     5
     6        Reviewed by Eric Carlson.
     7
     8        * fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
     9        * fast/mediastream/RTCPeerConnection-stable-expected.txt:
     10
    1112021-09-03  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt

    r281631 r281985  
    2121
    2222*** Try setting local descriptions with bad types for the current state
    23 PASS promise pc.setRemoteDescription({type:'answer', sdp:remoteOffer1.sdp}); rejected with InvalidStateError: Remote description type 2 is incompatible with current signaling state 0
    24 PASS promise pc.setRemoteDescription({type:'pranswer', sdp:remoteOffer1.sdp}); rejected with InvalidStateError: Remote description type 1 is incompatible with current signaling state 0
     23PASS promise pc.setRemoteDescription({type:'answer', sdp:remoteOffer1.sdp}); rejected with InvalidStateError: The object is in an invalid state.
     24PASS promise pc.setRemoteDescription({type:'pranswer', sdp:remoteOffer1.sdp}); rejected with InvalidStateError: The object is in an invalid state.
    2525
    2626*** Create (remote) offer with video (remoteOffer2)
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stable-expected.txt

    r281631 r281985  
    77PASS pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1); did not throw exception.
    88PASS setLocalDescription failed.
    9 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
     9FAIL errorReason.name should be InvalidSessionDescriptionError. Was OperationError.
    1010FAIL pc.localDescription should throw an exception. Was null.
    1111FAIL pc.remoteDescription should throw an exception. Was null.
     
    1313PASS pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed2); did not throw exception.
    1414PASS setLocalDescription failed.
    15 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
     15FAIL errorReason.name should be InvalidSessionDescriptionError. Was OperationError.
    1616FAIL pc.localDescription should throw an exception. Was null.
    1717FAIL pc.remoteDescription should throw an exception. Was null.
     
    1919PASS pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3); did not throw exception.
    2020PASS setRemoteDescription failed.
    21 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
     21FAIL errorReason.name should be InvalidSessionDescriptionError. Was SyntaxError.
    2222FAIL pc.localDescription should throw an exception. Was null.
    2323FAIL pc.remoteDescription should throw an exception. Was null.
     
    2525PASS pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed4); did not throw exception.
    2626PASS setRemoteDescription failed.
    27 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
     27FAIL errorReason.name should be InvalidSessionDescriptionError. Was SyntaxError.
    2828FAIL pc.localDescription should throw an exception. Was null.
    2929FAIL pc.remoteDescription should throw an exception. Was null.
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281981 r281985  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Signaling state check when applying a local or remote description is no longer aligned with the WebRTC spec
     4        https://bugs.webkit.org/show_bug.cgi?id=229138
     5
     6        Reviewed by Eric Carlson.
     7
     8        Rebasing tests.
     9        Some tests are going from PASS to FAIL:
     10        - LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https.html: we do not support yet rollback.
     11        - LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html:  is no longer throwing the right exception (and we are not supporting pranswer yet).
     12        - LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html: we are throwing with a different exception.
     13
     14        * web-platform-tests/webrtc/RTCPeerConnection-SLD-SRD-timing.https-expected.txt:
     15        * web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
     16        * web-platform-tests/webrtc/RTCPeerConnection-restartIce.https-expected.txt:
     17        * web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt:
     18        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt:
     19        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt:
     20        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer-expected.txt:
     21        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt:
     22        * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt:
     23        * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
     24        * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback-expected.txt:
     25        * web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:
     26
    1272021-09-03  Youenn Fablet  <youenn@apple.com>
    228
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-SLD-SRD-timing.https-expected.txt

    r281631 r281985  
    11
    2 FAIL setLocalDescription and setRemoteDescription are not racy promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
     2FAIL setLocalDescription and setRemoteDescription are not racy promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt

    r281981 r281985  
    66FAIL createOffer must detect InvalidStateError synchronously when chain is empty (prerequisite) assert_equals: expected "InvalidStateError" but got "Error"
    77PASS createAnswer must detect InvalidStateError synchronously when chain is empty (prerequisite)
    8 PASS SLD(rollback) must detect InvalidStateError synchronously when chain is empty
     8FAIL SLD(rollback) must detect InvalidStateError synchronously when chain is empty assert_equals: promise rejected on same task expected "rejected" but got "pending"
    99FAIL addIceCandidate must detect InvalidStateError synchronously when chain is empty assert_equals: expected "InvalidStateError" but got "TypeError"
    1010PASS replaceTrack must detect InvalidStateError synchronously when chain is empty and transceiver is stopped
     
    2727PASS receiver.getStats does NOT use the operations chain
    2828FAIL addIceCandidate chains onto SRD, fails before assert_equals: expected "InvalidStateError" but got "OperationError"
    29 FAIL Operations queue not vulnerable to recursion by chained negotiationneeded promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
     29FAIL Operations queue not vulnerable to recursion by chained negotiationneeded promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
    3030FAIL Pack operations queue with implicit offer and answer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
    3131TIMEOUT Negotiate solely by operations queue and signaling state Test timed out
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https-expected.txt

    r281631 r281985  
    1111PASS restartIce() is satisfied by remote ICE restart
    1212PASS restartIce() trumps {iceRestart: false}
    13 FAIL restartIce() survives rollback promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
     13PASS restartIce() survives rollback
    1414FAIL restartIce() survives remote offer containing partial restart assert_false: Restarted 2 expected false got true
    1515
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt

    r281631 r281985  
    22PASS setLocalDescription(offer) with m= section should assign mid to corresponding transceiver
    33PASS setRemoteDescription(offer) with m= section and no existing transceiver should create corresponding transceiver
    4 FAIL setLocalDescription(rollback) should unset transceiver.mid promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    5 FAIL setLocalDescription(rollback) should only unset transceiver mids associated with current round promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    6 FAIL setRemoteDescription(rollback) should remove newly created transceiver from transceiver list promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     4PASS setLocalDescription(rollback) should unset transceiver.mid
     5PASS setLocalDescription(rollback) should only unset transceiver mids associated with current round
     6FAIL setRemoteDescription(rollback) should remove newly created transceiver from transceiver list assert_array_equals: Expect transceiver to be removed from pc2's transceiver list lengths differ, expected array [] length 0, got [object "[object RTCRtpTransceiver]"] length 1
    77PASS setRemoteDescription should set transceiver inactive if its corresponding m section is rejected
    88
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt

    r281631 r281985  
    22PASS setLocalDescription() with valid answer should succeed
    33FAIL setLocalDescription() with type answer and null sdp should use lastAnswer generated from createAnswer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
    4 FAIL setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local answer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 0D:E2:FA:94:4D:00:FD:19:00:18:DC:96:C0:5D:20:81:53:91:E1:DE:73:E9:B6:99:A3:64:B9:F1:58:69:81:18 Got: sha-256 94:25:42:B4:B7:8C:8C:F5:DF:C5:ED:6A:82:03:44:0D:4E:1B:0A:B7:76:D6:BE:DA:72:80:7D:3D:6C:78:2B:F3" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
    5 FAIL Calling setLocalDescription(answer) from stable state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Local description type 2 is incompatible with current signaling state 0" that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
    6 FAIL Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Local description type 2 is incompatible with current signaling state 1" that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
    7 FAIL Setting previously generated answer after a call to createOffer should work promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     4FAIL setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local answer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 5A:90:E6:76:2B:68:BA:02:57:FC:0E:37:B6:BF:A7:1E:79:58:12:D4:6C:0D:84:CB:08:D2:F7:BB:01:9E:B9:CB Got: sha-256 05:68:D4:79:D9:47:72:10:F1:2A:F8:81:C7:C0:C5:28:4C:9B:B9:90:9A:60:81:E6:2C:31:35:E5:9D:C7:E2:0A" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
     5FAIL Calling setLocalDescription(answer) from stable state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Failed to set local answer sdp: no pending remote description." that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
     6FAIL Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Failed to set local answer sdp: no pending remote description." that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
     7PASS Setting previously generated answer after a call to createOffer should work
    88FAIL setLocalDescription(answer) should update internal state with a queued task, in the right order assert_not_equals: pendingRemoteDescription should not be set synchronously after a call to sLD got disallowed value null
    99
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt

    r281631 r281985  
    22PASS setLocalDescription with valid offer should succeed
    33FAIL setLocalDescription with type offer and null sdp should use lastOffer generated from createOffer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
    4 FAIL setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local offer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 AC:89:BE:E6:A4:DB:0A:BB:A7:A5:85:7E:53:F6:60:11:D8:97:44:6D:D0:A1:4C:32:80:B3:03:94:C8:83:AD:A8 Got: sha-256 34:AF:27:F0:FE:EF:83:BC:1D:76:C6:89:C7:D9:81:7C:C3:FB:DA:F0:04:CF:D3:81:FC:62:FA:9A:84:B5:3B:E8" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
     4FAIL setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local offer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 CB:DD:6C:16:C3:EB:2B:91:4B:45:55:4F:C1:45:DC:BF:53:7C:F4:4B:F5:07:80:18:31:8A:51:3A:35:0E:36:4C Got: sha-256 DD:D9:E2:F3:33:68:9A:4C:1D:FD:BE:CA:4E:0F:35:78:FC:B5:2A:0A:C8:E5:CD:E2:93:7B:C7:7A:99:C2:31:63" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
    55FAIL Set created offer other than last offer should reject with InvalidModificationError assert_unreached: Should have rejected: undefined Reached unreachable code
    66PASS Creating and setting offer multiple times should succeed
    7 FAIL Setting previously generated offer after a call to createAnswer should work promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     7PASS Setting previously generated offer after a call to createAnswer should work
    88FAIL Negotiation works when there has been a repeated setLocalDescription(offer) assert_equals: expected 1 but got 0
    99FAIL setLocalDescription(offer) should update internal state with a queued task, in the right order assert_equals: pendingRemoteDescription should never be set due to sLD expected null but got object "[object RTCSessionDescription]"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer-expected.txt

    r281631 r281985  
    11
    2 PASS setLocalDescription(pranswer) from stable state should reject with InvalidStateError
     2FAIL setLocalDescription(pranswer) from stable state should reject with InvalidStateError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local pranswer sdp: Called in wrong state: stable" that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
    33FAIL setLocalDescription(pranswer) should succeed assert_equals: expected null but got object "[object RTCSessionDescription]"
    44PASS setLocalDescription(pranswer) can be applied multiple times while still in have-local-pranswer
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt

    r281631 r281985  
    11
    2 FAIL setLocalDescription(rollback) from have-local-offer state should reset back to stable state promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
     2PASS setLocalDescription(rollback) from have-local-offer state should reset back to stable state
    33PASS setLocalDescription(rollback) from stable state should reject with InvalidStateError
    44PASS setLocalDescription(rollback) after setting answer description should reject with InvalidStateError
    5 FAIL setLocalDescription(rollback) should ignore invalid sdp content and succeed promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    6 FAIL setLocalDescription(rollback) should update internal state with a queued tassk, in the right order promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
     5PASS setLocalDescription(rollback) should ignore invalid sdp content and succeed
     6FAIL setLocalDescription(rollback) should update internal state with a queued tassk, in the right order assert_not_equals: pendingLocalDescription should not be set synchronously after a call to sLD got disallowed value null
    77
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt

    r281631 r281985  
    11
    22PASS setRemoteDescription with invalid type and invalid SDP should reject with TypeError
    3 PASS setRemoteDescription() with invalid SDP and stable state should reject with InvalidStateError
     3FAIL setRemoteDescription() with invalid SDP and stable state should reject with InvalidStateError assert_throws_dom: function "() => { throw e }" threw object "SyntaxError: Expect line: v=" that is not a DOMException InvalidStateError: property "code" is equal to 12, expected 11
    44PASS Negotiation should fire signalingsstate events
    55PASS Calling setRemoteDescription() again after one round of remote-offer/local-answer should succeed
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt

    r281631 r281985  
    66PASS setRemoteDescription multiple times with different offer should succeed
    77FAIL setRemoteDescription(offer) with invalid SDP should reject with RTCError assert_equals: Expect error detail field to set to sdp-syntax-error expected (string) "sdp-syntax-error" but got (undefined) undefined
    8 FAIL setRemoteDescription(offer) from have-local-offer should roll back and succeed promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
     8FAIL setRemoteDescription(offer) from have-local-offer should roll back and succeed promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
    99TIMEOUT setRemoteDescription(offer) from have-local-offer fires signalingstatechange twice Test timed out
    1010NOTRUN setRemoteDescription(offer) in stable should update internal state with a queued task, in the right order
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-rollback-expected.txt

    r281926 r281985  
    11
    2 FAIL setRemoteDescription(rollback) in have-remote-offer state should revert to stable state promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     2PASS setRemoteDescription(rollback) in have-remote-offer state should revert to stable state
    33PASS setRemoteDescription(rollback) from stable state should reject with InvalidStateError
    4 FAIL setRemoteDescription(rollback) should ignore invalid sdp content and succeed promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    5 FAIL local offer created before setRemoteDescription(remote offer) then rollback should still be usable promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    6 FAIL local offer created before setRemoteDescription(remote offer) with different transceiver level assignments then rollback should still be usable promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    7 FAIL rollback of a remote offer should remove a transceiver promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    8 FAIL rollback of a remote offer should remove touched transceiver promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    9 FAIL rollback of a remote offer should keep a transceiver promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    10 FAIL rollback of a remote offer should keep a transceiver created by addtrack promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    11 FAIL rollback of a remote offer should keep a transceiver without tracks promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    12 FAIL explicit rollback of local offer should remove transceivers and transport promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    13 FAIL when using addTransceiver, implicit rollback of a local offer should visit stable state, but not fire negotiationneeded until we settle in stable promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
    14 FAIL when using addTrack, implicit rollback of a local offer should visit stable state, but not fire negotiationneeded promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
    15 FAIL rollback of a remote offer to negotiated stable state should enable applying of a local offer promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
    16 FAIL rollback of a local offer to negotiated stable state should enable applying of a remote offer promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    17 FAIL rollback a local offer with audio direction change to negotiated stable state and then add video receiver promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    18 FAIL two transceivers with same mids promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
    19 FAIL onremovetrack fires during remote rollback promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     4PASS setRemoteDescription(rollback) should ignore invalid sdp content and succeed
     5PASS local offer created before setRemoteDescription(remote offer) then rollback should still be usable
     6PASS local offer created before setRemoteDescription(remote offer) with different transceiver level assignments then rollback should still be usable
     7FAIL rollback of a remote offer should remove a transceiver assert_equals: expected 0 but got 1
     8FAIL rollback of a remote offer should remove touched transceiver assert_equals: expected 0 but got 1
     9PASS rollback of a remote offer should keep a transceiver
     10PASS rollback of a remote offer should keep a transceiver created by addtrack
     11PASS rollback of a remote offer should keep a transceiver without tracks
     12PASS explicit rollback of local offer should remove transceivers and transport
     13FAIL when using addTransceiver, implicit rollback of a local offer should visit stable state, but not fire negotiationneeded until we settle in stable promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
     14FAIL when using addTrack, implicit rollback of a local offer should visit stable state, but not fire negotiationneeded promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
     15PASS rollback of a remote offer to negotiated stable state should enable applying of a local offer
     16PASS rollback of a local offer to negotiated stable state should enable applying of a remote offer
     17PASS rollback a local offer with audio direction change to negotiated stable state and then add video receiver
     18FAIL two transceivers with same mids promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
     19PASS onremovetrack fires during remote rollback
    2020FAIL rollback of a remote offer with stream changes assert_equals: expected 2 but got 1
    2121PASS removeTrack() with a sender being rolled back does not crash or throw
    22 FAIL Implicit rollback with only a datachannel works promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
     22FAIL Implicit rollback with only a datachannel works promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to set remote offer sdp: Called in wrong state: have-local-offer"
    2323
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt

    r281631 r281985  
    2222PASS checkRemoveAndReadd
    2323PASS checkAddTrackExistingTransceiverThenRemove
    24 FAIL checkRemoveTrackNegotiation promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     24FAIL checkRemoveTrackNegotiation assert_equals: Rollback should have added two tracks expected 2 but got 0
    2525FAIL checkMute assert_true: expected true got false
    2626FAIL checkStop assert_equals: expected "[{currentDirection:\"sendrecv\",direction:\"stopped\",receiver:{track:{kind:\"audio\",readyState:\"ended\"}},sender:{track:{kind:\"audio\"}}}]" but got "[{currentDirection:\"sendrecv\",direction:\"inactive\",receiver:{track:{kind:\"audio\",readyState:\"ended\"}},sender:{track:null}}]"
     
    3131FAIL checkStopAfterSetLocalAnswer assert_equals: expected "[{currentDirection:\"sendrecv\",direction:\"stopped\"}]" but got "[{currentDirection:\"sendrecv\",direction:\"inactive\"}]"
    3232PASS checkStopAfterClose
    33 FAIL checkLocalRollback promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    34 FAIL checkRollbackAndSetRemoteOfferWithDifferentType promise_test: Unhandled rejection with value: object "InvalidStateError: Local description type 3 is incompatible with current signaling state 1"
    35 FAIL checkRemoteRollback promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 3 is incompatible with current signaling state 2"
     33FAIL checkLocalRollback assert_equals: expected "[{direction:\"stopped\"}]" but got "[{direction:\"inactive\"}]"
     34PASS checkRollbackAndSetRemoteOfferWithDifferentType
     35FAIL checkRemoteRollback assert_equals: expected "[]" but got "[{}]"
    3636FAIL checkMsectionReuse assert_equals: expected "[{currentDirection:null,mid:null}]" but got "[{currentDirection:\"inactive\",mid:\"0\"}]"
    3737PASS checkStopAfterCreateOfferWithReusedMsection
    38 FAIL checkAddIceCandidateToStoppedTransceiver promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
     38PASS checkAddIceCandidateToStoppedTransceiver
    3939FAIL checkBundleTagRejected promise_test: Unhandled rejection with value: object "InvalidAccessError: Failed to set remote offer sdp: The m= section with mid='1' should be rejected."
    4040
  • trunk/Source/WebCore/ChangeLog

    r281984 r281985  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Signaling state check when applying a local or remote description is no longer aligned with the WebRTC spec
     4        https://bugs.webkit.org/show_bug.cgi?id=229138
     5
     6        Reviewed by Eric Carlson.
     7
     8        These checks have been removed from the spec and are no longer valid.
     9        Covered by rebased tests.
     10
     11        * Modules/mediastream/PeerConnectionBackend.cpp:
     12        (WebCore::PeerConnectionBackend::setLocalDescription):
     13        (WebCore::PeerConnectionBackend::setRemoteDescription):
     14        (WebCore::isLocalDescriptionTypeValidForState): Deleted.
     15        (WebCore::isRemoteDescriptionTypeValidForState): Deleted.
     16        * testing/MockLibWebRTCPeerConnection.cpp:
     17        (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
     18        (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
     19        * testing/MockLibWebRTCPeerConnection.h:
     20
    1212021-09-03  David Kilzer  <ddkilzer@apple.com>
    222
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

    r281981 r281985  
    161161}
    162162
    163 static inline bool isLocalDescriptionTypeValidForState(RTCSdpType type, RTCSignalingState state)
    164 {
    165     switch (state) {
    166     case RTCSignalingState::Stable:
    167         return type == RTCSdpType::Offer;
    168     case RTCSignalingState::HaveLocalOffer:
    169         return type == RTCSdpType::Offer;
    170     case RTCSignalingState::HaveRemoteOffer:
    171         return type == RTCSdpType::Answer || type == RTCSdpType::Pranswer;
    172     case RTCSignalingState::HaveLocalPranswer:
    173         return type == RTCSdpType::Answer || type == RTCSdpType::Pranswer;
    174     default:
    175         return false;
    176     };
    177 
    178     ASSERT_NOT_REACHED();
    179     return false;
    180 }
    181 
    182163void PeerConnectionBackend::setLocalDescription(const RTCSessionDescription* sessionDescription, DOMPromiseDeferred<void>&& promise)
    183164{
    184165    ASSERT(!m_peerConnection.isClosed());
    185 
    186     if (sessionDescription && !isLocalDescriptionTypeValidForState(sessionDescription->type(), m_peerConnection.signalingState())) {
    187         promise.reject(InvalidStateError, makeString("Local description type ", sessionDescription->type(), " is incompatible with current signaling state ", m_peerConnection.signalingState()));
    188         return;
    189     }
    190166
    191167    m_setDescriptionPromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
     
    221197}
    222198
    223 static inline bool isRemoteDescriptionTypeValidForState(RTCSdpType type, RTCSignalingState state)
    224 {
    225     switch (state) {
    226     case RTCSignalingState::Stable:
    227         return type == RTCSdpType::Offer;
    228     case RTCSignalingState::HaveLocalOffer:
    229         return type == RTCSdpType::Answer || type == RTCSdpType::Pranswer;
    230     case RTCSignalingState::HaveRemoteOffer:
    231         return type == RTCSdpType::Offer;
    232     case RTCSignalingState::HaveRemotePranswer:
    233         return type == RTCSdpType::Answer || type == RTCSdpType::Pranswer;
    234     default:
    235         return false;
    236     };
    237 
    238     ASSERT_NOT_REACHED();
    239     return false;
    240 }
    241 
    242199void PeerConnectionBackend::setRemoteDescription(const RTCSessionDescription& sessionDescription, DOMPromiseDeferred<void>&& promise)
    243200{
    244201    ASSERT(!m_peerConnection.isClosed());
    245 
    246     if (!isRemoteDescriptionTypeValidForState(sessionDescription.type(), m_peerConnection.signalingState())) {
    247         promise.reject(InvalidStateError, makeString("Remote description type ", sessionDescription.type(), " is incompatible with current signaling state ", m_peerConnection.signalingState()));
    248         return;
    249     }
    250202
    251203    m_setDescriptionPromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
  • trunk/Source/WebCore/platform/mediastream/RTCSignalingState.h

    r281631 r281985  
    2626
    2727#if ENABLE(WEB_RTC)
     28
     29#include <wtf/text/WTFString.h>
    2830
    2931namespace WebCore {
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp

    r281926 r281985  
    263263void MockLibWebRTCPeerConnection::SetLocalDescription(webrtc::SetSessionDescriptionObserver* observer, webrtc::SessionDescriptionInterface* sessionDescription)
    264264{
     265    bool isCorrectState = true;
     266    switch (m_signalingState) {
     267    case RTCSignalingState::Stable:
     268    case RTCSignalingState::HaveLocalOffer:
     269        isCorrectState = sessionDescription->GetType() == webrtc::SdpType::kOffer;
     270        if (isCorrectState)
     271            m_signalingState = RTCSignalingState::HaveLocalOffer;
     272        break;
     273    case RTCSignalingState::HaveRemoteOffer:
     274        isCorrectState = sessionDescription->GetType() == webrtc::SdpType::kAnswer;
     275        if (isCorrectState)
     276            m_signalingState = RTCSignalingState::Stable;
     277        break;
     278    case RTCSignalingState::HaveLocalPranswer:
     279    case RTCSignalingState::HaveRemotePranswer:
     280    case RTCSignalingState::Closed:
     281        isCorrectState = false;
     282    }
     283    if (!isCorrectState) {
     284        LibWebRTCProvider::callOnWebRTCSignalingThread([observer] {
     285            observer->OnFailure(webrtc::RTCError(webrtc::RTCErrorType::INVALID_STATE));
     286        });
     287        return;
     288    }
     289
    265290    std::unique_ptr<webrtc::SessionDescriptionInterface> toBeFreed(sessionDescription);
    266291    LibWebRTCProvider::callOnWebRTCSignalingThread([this, observer] {
     
    272297void MockLibWebRTCPeerConnection::SetRemoteDescription(webrtc::SetSessionDescriptionObserver* observer, webrtc::SessionDescriptionInterface* sessionDescription)
    273298{
     299    bool isCorrectState = true;
     300    switch (m_signalingState) {
     301    case RTCSignalingState::HaveRemoteOffer:
     302    case RTCSignalingState::Stable:
     303        isCorrectState = sessionDescription->GetType() == webrtc::SdpType::kOffer;
     304        if (isCorrectState)
     305            m_signalingState = RTCSignalingState::HaveRemoteOffer;
     306        break;
     307    case RTCSignalingState::HaveLocalOffer:
     308        isCorrectState = sessionDescription->GetType() == webrtc::SdpType::kAnswer;
     309        if (isCorrectState)
     310            m_signalingState = RTCSignalingState::Stable;
     311        break;
     312    case RTCSignalingState::HaveLocalPranswer:
     313    case RTCSignalingState::HaveRemotePranswer:
     314    case RTCSignalingState::Closed:
     315        isCorrectState = false;
     316    }
     317    if (!isCorrectState) {
     318        LibWebRTCProvider::callOnWebRTCSignalingThread([observer] {
     319            observer->OnFailure(webrtc::RTCError(webrtc::RTCErrorType::INVALID_STATE));
     320        });
     321        return;
     322    }
     323
    274324    std::unique_ptr<webrtc::SessionDescriptionInterface> toBeFreed(sessionDescription);
    275325    LibWebRTCProvider::callOnWebRTCSignalingThread([observer] {
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h

    r281981 r281985  
    2828
    2929#include "LibWebRTCMacros.h"
     30#include "RTCSignalingState.h"
    3031
    3132ALLOW_UNUSED_PARAMETERS_BEGIN
     
    327328    bool m_isReceivingVideo { false };
    328329    std::string m_streamLabel;
     330    RTCSignalingState m_signalingState { RTCSignalingState::Stable };
    329331};
    330332
Note: See TracChangeset for help on using the changeset viewer.