Skip to content

Commit dc301bc

Browse files
committed
Add support for RTCPeerConnection.onicecandidateerror event
https://bugs.webkit.org/show_bug.cgi?id=169644 Reviewed by Alex Christensen. LayoutTests/imported/w3c: * web-platform-tests/webrtc/idlharness.https.window-expected.txt: Source/WebCore: Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs. For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary. Covered by updated webrtc/stun-server-filtering.html test. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::iceServersFromConfiguration): (WebCore::iceServersFromConfiguration): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added. (WebCore::RTCPeerConnectionIceErrorEvent::create): (WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent): (WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const): * Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added. * Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.h: * dom/EventNames.in: LayoutTests: * webrtc/rtcpeerconnection-error-messages-expected.txt: * webrtc/stun-server-filtering.html: Canonical link: https://commits.webkit.org/231814@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 0c95447 commit dc301bc

21 files changed

Lines changed: 302 additions & 28 deletions

LayoutTests/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2020-11-20 Youenn Fablet <youenn@apple.com>
2+
3+
Add support for RTCPeerConnection.onicecandidateerror event
4+
https://bugs.webkit.org/show_bug.cgi?id=169644
5+
6+
Reviewed by Alex Christensen.
7+
8+
* webrtc/rtcpeerconnection-error-messages-expected.txt:
9+
* webrtc/stun-server-filtering.html:
10+
111
2020-11-19 Zalan Bujtas <zalan@apple.com>
212

313
[LFC][Integration] Enable inline-block

LayoutTests/imported/w3c/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2020-11-20 Youenn Fablet <youenn@apple.com>
2+
3+
Add support for RTCPeerConnection.onicecandidateerror event
4+
https://bugs.webkit.org/show_bug.cgi?id=169644
5+
6+
Reviewed by Alex Christensen.
7+
8+
* web-platform-tests/webrtc/idlharness.https.window-expected.txt:
9+
110
2020-11-16 Sergio Villar Senin <svillar@igalia.com>
211

312
[css-flex] Images as flex items should use the overridingLogicalHeight when defined to compute the logical width

LayoutTests/imported/w3c/web-platform-tests/webrtc/idlharness.https.window-expected.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ FAIL RTCPeerConnection interface: operation setConfiguration(optional RTCConfigu
4444
PASS RTCPeerConnection interface: operation close()
4545
PASS RTCPeerConnection interface: attribute onnegotiationneeded
4646
PASS RTCPeerConnection interface: attribute onicecandidate
47-
FAIL RTCPeerConnection interface: attribute onicecandidateerror assert_true: The prototype object must have a property "onicecandidateerror" expected true got false
47+
PASS RTCPeerConnection interface: attribute onicecandidateerror
4848
PASS RTCPeerConnection interface: attribute onsignalingstatechange
4949
PASS RTCPeerConnection interface: attribute oniceconnectionstatechange
5050
PASS RTCPeerConnection interface: attribute onicegatheringstatechange
@@ -96,7 +96,7 @@ PASS RTCPeerConnection interface: calling setConfiguration(optional RTCConfigura
9696
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "close()" with the proper type
9797
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onnegotiationneeded" with the proper type
9898
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onicecandidate" with the proper type
99-
FAIL RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onicecandidateerror" with the proper type assert_inherits: property "onicecandidateerror" not found in prototype chain
99+
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onicecandidateerror" with the proper type
100100
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onsignalingstatechange" with the proper type
101101
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "oniceconnectionstatechange" with the proper type
102102
PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "onicegatheringstatechange" with the proper type
@@ -195,24 +195,24 @@ PASS RTCPeerConnectionIceEvent must be primary interface of new RTCPeerConnectio
195195
PASS Stringification of new RTCPeerConnectionIceEvent('ice')
196196
PASS RTCPeerConnectionIceEvent interface: new RTCPeerConnectionIceEvent('ice') must inherit property "candidate" with the proper type
197197
PASS RTCPeerConnectionIceEvent interface: new RTCPeerConnectionIceEvent('ice') must inherit property "url" with the proper type
198-
FAIL RTCPeerConnectionIceErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
199-
FAIL RTCPeerConnectionIceErrorEvent interface object length assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
200-
FAIL RTCPeerConnectionIceErrorEvent interface object name assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
201-
FAIL RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
202-
FAIL RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
203-
FAIL RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
204-
FAIL RTCPeerConnectionIceErrorEvent interface: attribute address assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
205-
FAIL RTCPeerConnectionIceErrorEvent interface: attribute port assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
206-
FAIL RTCPeerConnectionIceErrorEvent interface: attribute url assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
207-
FAIL RTCPeerConnectionIceErrorEvent interface: attribute errorCode assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
208-
FAIL RTCPeerConnectionIceErrorEvent interface: attribute errorText assert_own_property: self does not have own property "RTCPeerConnectionIceErrorEvent" expected property "RTCPeerConnectionIceErrorEvent" missing
209-
FAIL RTCPeerConnectionIceErrorEvent must be primary interface of new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
210-
FAIL Stringification of new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
211-
FAIL RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "address" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
212-
FAIL RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "port" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
213-
FAIL RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "url" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
214-
FAIL RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "errorCode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
215-
FAIL RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "errorText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: RTCPeerConnectionIceErrorEvent"
198+
PASS RTCPeerConnectionIceErrorEvent interface: existence and properties of interface object
199+
PASS RTCPeerConnectionIceErrorEvent interface object length
200+
PASS RTCPeerConnectionIceErrorEvent interface object name
201+
PASS RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object
202+
PASS RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's "constructor" property
203+
PASS RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's @@unscopables property
204+
PASS RTCPeerConnectionIceErrorEvent interface: attribute address
205+
PASS RTCPeerConnectionIceErrorEvent interface: attribute port
206+
PASS RTCPeerConnectionIceErrorEvent interface: attribute url
207+
PASS RTCPeerConnectionIceErrorEvent interface: attribute errorCode
208+
PASS RTCPeerConnectionIceErrorEvent interface: attribute errorText
209+
PASS RTCPeerConnectionIceErrorEvent must be primary interface of new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 });
210+
PASS Stringification of new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 });
211+
PASS RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "address" with the proper type
212+
PASS RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "port" with the proper type
213+
PASS RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "url" with the proper type
214+
PASS RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "errorCode" with the proper type
215+
PASS RTCPeerConnectionIceErrorEvent interface: new RTCPeerConnectionIceErrorEvent('ice-error', { port: 0, errorCode: 701 }); must inherit property "errorText" with the proper type
216216
PASS RTCCertificate interface: existence and properties of interface object
217217
PASS RTCCertificate interface object length
218218
PASS RTCCertificate interface object name

LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TypeError: Can only call RTCPeerConnection.setConfiguration on instances of RTCP
1515
TypeError: Can only call RTCPeerConnection.close on instances of RTCPeerConnection
1616
TypeError: The RTCPeerConnection.onnegotiationneeded getter can only be used on instances of RTCPeerConnection
1717
TypeError: The RTCPeerConnection.onicecandidate getter can only be used on instances of RTCPeerConnection
18-
[object RTCPeerConnection] has no property named onicecandidateerror
18+
TypeError: The RTCPeerConnection.onicecandidateerror getter can only be used on instances of RTCPeerConnection
1919
TypeError: The RTCPeerConnection.onsignalingstatechange getter can only be used on instances of RTCPeerConnection
2020
TypeError: The RTCPeerConnection.oniceconnectionstatechange getter can only be used on instances of RTCPeerConnection
2121
TypeError: The RTCPeerConnection.onicegatheringstatechange getter can only be used on instances of RTCPeerConnection

LayoutTests/webrtc/stun-server-filtering.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,29 @@
22
<script src='../resources/testharness.js'></script>
33
<script src='../resources/testharnessreport.js'></script>
44
<script>
5-
test((test) => {
5+
promise_test(async (test) => {
66
let pc = new RTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'stun:blabla.local']}]});
7+
let promise = new Promise(resolve => pc.onicecandidateerror = resolve);
78
let configuration = pc.getConfiguration();
89

910
assert_equals(configuration.iceServers[0].urls.length, 1);
1011
assert_equals(configuration.iceServers[0].urls[0], 'stun:foo.com');
12+
13+
const event = await promise;
14+
assert_equals(event.url, 'stun:blabla.local');
15+
assert_equals(event.errorCode, 701);
1116
}, "RTCPeerConnection and local STUN server");
1217

13-
test((test) => {
18+
promise_test(async (test) => {
1419
let pc = new RTCPeerConnection({iceServers:[{username: 'test', credential: 'test', urls:['turn:foo.com', 'turn:blabla.local']}]});
20+
let promise = new Promise(resolve => pc.onicecandidateerror = resolve);
1521
let configuration = pc.getConfiguration();
1622

1723
assert_equals(configuration.iceServers[0].urls.length, 1);
1824
assert_equals(configuration.iceServers[0].urls[0], 'turn:foo.com');
25+
26+
const event = await promise;
27+
assert_equals(event.url, 'turn:blabla.local');
28+
assert_equals(event.errorCode, 701);
1929
}, "RTCPeerConnection and local TURN server");
2030
</script>

Source/WebCore/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ set(WebCore_NON_SVG_IDL_FILES
389389
Modules/mediastream/RTCOfferAnswerOptions.idl
390390
Modules/mediastream/RTCOfferOptions.idl
391391
Modules/mediastream/RTCPeerConnection.idl
392+
Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl
392393
Modules/mediastream/RTCPeerConnectionIceEvent.idl
393394
Modules/mediastream/RTCPeerConnectionState.idl
394395
Modules/mediastream/RTCPriorityType.idl

Source/WebCore/ChangeLog

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
2020-11-20 Youenn Fablet <youenn@apple.com>
2+
3+
Add support for RTCPeerConnection.onicecandidateerror event
4+
https://bugs.webkit.org/show_bug.cgi?id=169644
5+
6+
Reviewed by Alex Christensen.
7+
8+
Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs.
9+
For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary.
10+
11+
Covered by updated webrtc/stun-server-filtering.html test.
12+
13+
* CMakeLists.txt:
14+
* DerivedSources-input.xcfilelist:
15+
* DerivedSources-output.xcfilelist:
16+
* DerivedSources.make:
17+
* Modules/mediastream/RTCPeerConnection.cpp:
18+
(WebCore::RTCPeerConnection::iceServersFromConfiguration):
19+
(WebCore::iceServersFromConfiguration): Deleted.
20+
* Modules/mediastream/RTCPeerConnection.h:
21+
* Modules/mediastream/RTCPeerConnection.idl:
22+
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added.
23+
(WebCore::RTCPeerConnectionIceErrorEvent::create):
24+
(WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent):
25+
(WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const):
26+
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added.
27+
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added.
28+
* Sources.txt:
29+
* WebCore.xcodeproj/project.pbxproj:
30+
* bindings/js/WebCoreBuiltinNames.h:
31+
* dom/EventNames.h:
32+
* dom/EventNames.in:
33+
134
2020-11-16 Sergio Villar Senin <svillar@igalia.com>
235

336
[css-flex] Images as flex items should use the overridingLogicalHeight when defined to compute the logical width

Source/WebCore/DerivedSources-input.xcfilelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ $(PROJECT_DIR)/Modules/mediastream/RTCOfferAnswerOptions.idl
220220
$(PROJECT_DIR)/Modules/mediastream/RTCOfferOptions.idl
221221
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnection.idl
222222
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnection.js
223+
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl
223224
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionIceEvent.idl
224225
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionInternals.js
225226
$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionState.idl

Source/WebCore/DerivedSources-output.xcfilelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,6 +1677,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferOptions.cpp
16771677
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferOptions.h
16781678
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnection.cpp
16791679
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnection.h
1680+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceErrorEvent.cpp
1681+
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceErrorEvent.h
16801682
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceEvent.cpp
16811683
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceEvent.h
16821684
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionState.cpp

Source/WebCore/DerivedSources.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ JS_BINDING_IDLS := \
246246
$(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
247247
$(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
248248
$(WebCore)/Modules/mediastream/RTCPeerConnectionIceEvent.idl \
249+
$(WebCore)/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl \
249250
$(WebCore)/Modules/mediastream/RTCPeerConnectionState.idl \
250251
$(WebCore)/Modules/mediastream/RTCPriorityType.idl \
251252
$(WebCore)/Modules/mediastream/RTCRtpCapabilities.idl \

0 commit comments

Comments
 (0)