Skip to content

Commit

Permalink
Sync RTCIceServer as per web-specification
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=276595

Reviewed by Youenn Fablet.

This patch syncs `RTCIceServer` as per web specification [1]:

[1] https://w3c.github.io/webrtc-pc/#dom-rtciceserver

It removes `RTCIceCredentialType` as per [2]:

[2] w3c/webrtc-pc#2767

* Source/WebCore/Modules/mediastream/RTCIceServer.h:
* Source/WebCore/Modules/mediastream/RTCIceServer.idl:
* LayoutTests/imported/w3c/web-platform-tests/webrtc-extensions/RTCOAuthCredential-expected.txt: Rebaselined

Canonical link: https://commits.webkit.org/281007@main
  • Loading branch information
Ahmad Saleem committed Jul 16, 2024
1 parent 3f928ad commit b7d6d76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ FAIL new RTCPeerConnection(config) - with turns server, credentialType oauth, an
credentialType: 'oauth',
username: 'user',
credential: 'cred'
}] })" threw object "TypeError: Type error" that is not a DOMException InvalidAccessError: property "code" is equal to undefined, expected 15
}] })" did not throw
FAIL setConfiguration(config) - with turns server, credentialType oauth, and string credential should throw InvalidAccessError assert_throws_dom: function "() =>
makePc({ iceServers: [{
urls: 'turns:turn.example.org',
credentialType: 'oauth',
username: 'user',
credential: 'cred'
}] })" threw object "TypeError: Type error" that is not a DOMException InvalidAccessError: property "code" is equal to undefined, expected 15
FAIL new RTCPeerConnection(config) - with turns server, credential type and credential from spec should not throw Type error
FAIL setConfiguration(config) - with turns server, credential type and credential from spec should not throw Type error
}] })" did not throw
FAIL new RTCPeerConnection(config) - with turns server, credential type and credential from spec should not throw assert_equals: expected (string) "oauth" but got (undefined) undefined
FAIL setConfiguration(config) - with turns server, credential type and credential from spec should not throw assert_equals: expected (string) "oauth" but got (undefined) undefined

5 changes: 1 addition & 4 deletions Source/WebCore/Modules/mediastream/RTCIceServer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
* Copyright (C) 2014-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -34,12 +34,9 @@
namespace WebCore {

struct RTCIceServer {
enum class CredentialType { Password };

std::variant<String, Vector<String>> urls;
String username;
String credential;
CredentialType credentialType { CredentialType::Password };
};

} // namespace WebCore
Expand Down
7 changes: 2 additions & 5 deletions Source/WebCore/Modules/mediastream/RTCIceServer.idl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2017 Apple Inc. All rights reserved.
* Copyright (C) 2014-2024 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -23,9 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

enum RTCIceCredentialType {
"password"
};
// https://w3c.github.io/webrtc-pc/#dom-rtciceserver

[
Conditional=WEB_RTC,
Expand All @@ -36,5 +34,4 @@ enum RTCIceCredentialType {
required (DOMString or sequence<DOMString>) urls;
DOMString username;
DOMString credential;
RTCIceCredentialType credentialType = "password";
};

0 comments on commit b7d6d76

Please sign in to comment.