haikuwebkit/LayoutTests/fast/mediastream/RTCPeerConnection-overloade...

78 lines
2.8 KiB
HTML
Raw Permalink Normal View History

WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
var pc;
var result;
var desc;
var candidate;
description("Test which overloaded RTCPeerConnection function that gets invoked (by return value)");
Expose RTCPeerConnection unprefixed https://bugs.webkit.org/show_bug.cgi?id=164060 Patch by Youenn Fablet <youenn@apple.com> on 2016-10-28 Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/webrtc/datachannel-emptystring-expected.txt: Added. * web-platform-tests/webrtc/no-media-call-expected.txt: Added. * web-platform-tests/webrtc/promises-call-expected.txt: Added. * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt: Added. * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt: Added. * web-platform-tests/webrtc/simplecall-expected.txt: Added. Source/WebCore: Covered by rebased and activated tests. * Modules/mediastream/RTCPeerConnection.idl: LayoutTests: * TestExpectations: * fast/mediastream/RTCPeerConnection-AddRemoveStream.html: * fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt: * fast/mediastream/RTCPeerConnection-add-removeTrack.html: * fast/mediastream/RTCPeerConnection-addIceCandidate.html: * fast/mediastream/RTCPeerConnection-addTrack-reuse-sender.html: * fast/mediastream/RTCPeerConnection-addTransceiver.html: * fast/mediastream/RTCPeerConnection-closed-state-expected.txt: * fast/mediastream/RTCPeerConnection-closed-state.html: * fast/mediastream/RTCPeerConnection-createAnswer.html: * fast/mediastream/RTCPeerConnection-createOffer.html: * fast/mediastream/RTCPeerConnection-datachannel.html: * fast/mediastream/RTCPeerConnection-dtmf.html: * fast/mediastream/RTCPeerConnection-events.html: * fast/mediastream/RTCPeerConnection-expected.txt: * fast/mediastream/RTCPeerConnection-getConfiguration.html: * fast/mediastream/RTCPeerConnection-have-local-offer.html: * fast/mediastream/RTCPeerConnection-have-local-pranswer.html: * fast/mediastream/RTCPeerConnection-have-remote-offer.html: * fast/mediastream/RTCPeerConnection-have-remote-pranswer.html: * fast/mediastream/RTCPeerConnection-ice-expected.txt: * fast/mediastream/RTCPeerConnection-ice.html: * fast/mediastream/RTCPeerConnection-icecandidate-event.html: * fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html: * fast/mediastream/RTCPeerConnection-inspect-answer.html: * fast/mediastream/RTCPeerConnection-inspect-offer.html: * fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt: * fast/mediastream/RTCPeerConnection-js-built-ins-check-this.html: * fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html: * fast/mediastream/RTCPeerConnection-localDescription.html: * fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html: * fast/mediastream/RTCPeerConnection-media-setup-single-dialog.html: * fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html: * fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html: * fast/mediastream/RTCPeerConnection-onnegotiationneeded.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: * fast/mediastream/RTCPeerConnection-remoteDescription.html: * fast/mediastream/RTCPeerConnection-remotely-assigned-transceiver-mid.html: * fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html: * fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html: * fast/mediastream/RTCPeerConnection-stable.html: * fast/mediastream/RTCPeerConnection-stats-expected.txt: * fast/mediastream/RTCPeerConnection-stats.html: * fast/mediastream/RTCPeerConnection-statsSelector-expected.txt: * fast/mediastream/RTCPeerConnection-statsSelector.html: * fast/mediastream/RTCPeerConnection.html: * fast/mediastream/RTCRtpSender-replaceTrack.html: * fast/mediastream/RTCTrackEvent-constructor.html: * platform/efl/TestExpectations: * platform/efl/js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/181842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 18:09:41 +00:00
shouldNotThrow("pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});");
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
// Test createOffer/Answer()
testCreateOfferOrAnswer("createOffer");
testCreateOfferOrAnswer("createAnswer");
function testCreateOfferOrAnswer(functionName) {
shouldNotThrow("result = pc." + functionName + "()");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc." + functionName + "({})");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc." + functionName + "(emptyFunc, emptyFunc)");
WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise https://bugs.webkit.org/show_bug.cgi?id=158114 Reviewed by Eric Carlson. Source/WebCore: Update overloaded operations so that the legacy callback versions also return a promise and never throw [1]. [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions Updated existing tests. - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html - fast/mediastream/RTCPeerConnection-overloaded-operations.html * Modules/mediastream/RTCPeerConnection.idl: Updated legacy signatures (just for documentation purposes) * Modules/mediastream/RTCPeerConnection.js: Implements the promise overload and the legacy callbacks overload (using the promise version) as specified in [1] (above). (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionInternals.js: Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that process an argument list and determine which overloaded version to use. (callbacksAndDictionaryOverload): (setLocalOrRemoteDescription): Deleted. (extractCallbackArg): Deleted. LayoutTests: Updated existing tests (see below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Test various combinations of good and bad arguments and verify that no errors are thrown. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Test that all overloaded versions return a promise. * fast/mediastream/resources/promise-utils.js: Added. Shared utils to make it easier to test async promise APIs. (ensurePromise): (promiseShouldReject): (promiseShouldNotRejectWithTypeError.): Canonical link: https://commits.webkit.org/176258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-27 18:35:49 +00:00
shouldBeType("result", "Promise");
result.then(() => { }, () => { });
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
shouldNotThrow("result = pc." + functionName + "(emptyFunc, emptyFunc, {})");
WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise https://bugs.webkit.org/show_bug.cgi?id=158114 Reviewed by Eric Carlson. Source/WebCore: Update overloaded operations so that the legacy callback versions also return a promise and never throw [1]. [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions Updated existing tests. - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html - fast/mediastream/RTCPeerConnection-overloaded-operations.html * Modules/mediastream/RTCPeerConnection.idl: Updated legacy signatures (just for documentation purposes) * Modules/mediastream/RTCPeerConnection.js: Implements the promise overload and the legacy callbacks overload (using the promise version) as specified in [1] (above). (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionInternals.js: Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that process an argument list and determine which overloaded version to use. (callbacksAndDictionaryOverload): (setLocalOrRemoteDescription): Deleted. (extractCallbackArg): Deleted. LayoutTests: Updated existing tests (see below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Test various combinations of good and bad arguments and verify that no errors are thrown. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Test that all overloaded versions return a promise. * fast/mediastream/resources/promise-utils.js: Added. Shared utils to make it easier to test async promise APIs. (ensurePromise): (promiseShouldReject): (promiseShouldNotRejectWithTypeError.): Canonical link: https://commits.webkit.org/176258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-27 18:35:49 +00:00
shouldBeType("result", "Promise");
result.then(() => { }, () => { });
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
}
// Test setLocal/RemoteDescription()
shouldNotThrow("desc = new RTCSessionDescription({ type: 'offer', sdp: 'x' });");
testSetLocalOrRemoteDescription("setLocalDescription")
testSetLocalOrRemoteDescription("setRemoteDescription")
function testSetLocalOrRemoteDescription(functionName) {
shouldNotThrow("result = pc." + functionName + "(desc)");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc." + functionName + "(desc, emptyFunc, emptyFunc)");
WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise https://bugs.webkit.org/show_bug.cgi?id=158114 Reviewed by Eric Carlson. Source/WebCore: Update overloaded operations so that the legacy callback versions also return a promise and never throw [1]. [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions Updated existing tests. - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html - fast/mediastream/RTCPeerConnection-overloaded-operations.html * Modules/mediastream/RTCPeerConnection.idl: Updated legacy signatures (just for documentation purposes) * Modules/mediastream/RTCPeerConnection.js: Implements the promise overload and the legacy callbacks overload (using the promise version) as specified in [1] (above). (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionInternals.js: Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that process an argument list and determine which overloaded version to use. (callbacksAndDictionaryOverload): (setLocalOrRemoteDescription): Deleted. (extractCallbackArg): Deleted. LayoutTests: Updated existing tests (see below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Test various combinations of good and bad arguments and verify that no errors are thrown. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Test that all overloaded versions return a promise. * fast/mediastream/resources/promise-utils.js: Added. Shared utils to make it easier to test async promise APIs. (ensurePromise): (promiseShouldReject): (promiseShouldNotRejectWithTypeError.): Canonical link: https://commits.webkit.org/176258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-27 18:35:49 +00:00
shouldBeType("result", "Promise");
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
}
// Test addIceCandidate()
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
candidate = new RTCIceCandidate({ "candidate": "foo", "sdpMid": "bar" });
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
shouldNotThrow("result = pc.addIceCandidate(candidate)");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc.addIceCandidate(candidate, emptyFunc, emptyFunc)");
WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise https://bugs.webkit.org/show_bug.cgi?id=158114 Reviewed by Eric Carlson. Source/WebCore: Update overloaded operations so that the legacy callback versions also return a promise and never throw [1]. [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions Updated existing tests. - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html - fast/mediastream/RTCPeerConnection-overloaded-operations.html * Modules/mediastream/RTCPeerConnection.idl: Updated legacy signatures (just for documentation purposes) * Modules/mediastream/RTCPeerConnection.js: Implements the promise overload and the legacy callbacks overload (using the promise version) as specified in [1] (above). (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionInternals.js: Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that process an argument list and determine which overloaded version to use. (callbacksAndDictionaryOverload): (setLocalOrRemoteDescription): Deleted. (extractCallbackArg): Deleted. LayoutTests: Updated existing tests (see below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Test various combinations of good and bad arguments and verify that no errors are thrown. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Test that all overloaded versions return a promise. * fast/mediastream/resources/promise-utils.js: Added. Shared utils to make it easier to test async promise APIs. (ensurePromise): (promiseShouldReject): (promiseShouldNotRejectWithTypeError.): Canonical link: https://commits.webkit.org/176258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-27 18:35:49 +00:00
shouldBeType("result", "Promise");
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
// Test getStats()
shouldNotThrow("result = pc.getStats()");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc.getStats(null)");
shouldBeType("result", "Promise");
shouldNotThrow("result = pc.getStats(null, emptyFunc, emptyFunc)");
WebRTC: Update RTCPeerConnection overloaded legacy operations to return a Promise https://bugs.webkit.org/show_bug.cgi?id=158114 Reviewed by Eric Carlson. Source/WebCore: Update overloaded operations so that the legacy callback versions also return a promise and never throw [1]. [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#legacy-interface-extensions Updated existing tests. - fast/mediastream/RTCPeerConnection-overloaded-operations-params.html - fast/mediastream/RTCPeerConnection-overloaded-operations.html * Modules/mediastream/RTCPeerConnection.idl: Updated legacy signatures (just for documentation purposes) * Modules/mediastream/RTCPeerConnection.js: Implements the promise overload and the legacy callbacks overload (using the promise version) as specified in [1] (above). (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): (getStats): * Modules/mediastream/RTCPeerConnectionInternals.js: Added helper functions objectAndCallbacksOverload and callbacksAndDictionaryOverload that process an argument list and determine which overloaded version to use. (callbacksAndDictionaryOverload): (setLocalOrRemoteDescription): Deleted. (extractCallbackArg): Deleted. LayoutTests: Updated existing tests (see below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Test various combinations of good and bad arguments and verify that no errors are thrown. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Test that all overloaded versions return a promise. * fast/mediastream/resources/promise-utils.js: Added. Shared utils to make it easier to test async promise APIs. (ensurePromise): (promiseShouldReject): (promiseShouldNotRejectWithTypeError.): Canonical link: https://commits.webkit.org/176258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-27 18:35:49 +00:00
shouldBeType("result", "Promise");
WebRTC: Initial testing of updated RTCPeerConnection API https://bugs.webkit.org/show_bug.cgi?id=151304 Reviewed by Eric Carlson. Source/WebCore: Add an empty implementation of MediaEndpointPeerConnection which realizes the PeerConnectionBackend interface. This makes it possible to construct an RTCPeerConnection and do initial testing. Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html fast/mediastream/RTCPeerConnection-overloaded-operations.html Also unskip three existing RTCPeerConnection tests on GTK. * CMakeLists.txt: * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added. (WebCore::createMediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): (WebCore::MediaEndpointPeerConnection::createOffer): (WebCore::MediaEndpointPeerConnection::createAnswer): (WebCore::MediaEndpointPeerConnection::setLocalDescription): (WebCore::MediaEndpointPeerConnection::localDescription): (WebCore::MediaEndpointPeerConnection::currentLocalDescription): (WebCore::MediaEndpointPeerConnection::pendingLocalDescription): (WebCore::MediaEndpointPeerConnection::setRemoteDescription): (WebCore::MediaEndpointPeerConnection::remoteDescription): (WebCore::MediaEndpointPeerConnection::currentRemoteDescription): (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription): (WebCore::MediaEndpointPeerConnection::setConfiguration): (WebCore::MediaEndpointPeerConnection::addIceCandidate): (WebCore::MediaEndpointPeerConnection::getStats): (WebCore::MediaEndpointPeerConnection::stop): (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): * Modules/mediastream/MediaEndpointPeerConnection.h: Added. * WebCore.xcodeproj/project.pbxproj: LayoutTests: Add two new tests and unskip three old ones (details below). * fast/mediastream/RTCPeerConnection-overloaded-operations-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added. * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html: Added. Feeds some good but mostly bad input to the overloaded operations to verify JS built-ins argument checking. * fast/mediastream/RTCPeerConnection-overloaded-operations.html: Added. Verifies that the correct overloaded operation is invoked. For examaple, createOffer() without arguments should invoke the promise based function, but the same operation with two function arguments should invoke the legacy callback version. * platform/gtk/TestExpectations: Unskip fast/mediastream/RTCIceCandidate.html, fast/mediastream/RTCPeerConnection.html and fast/mediastream/RTCSessionDescription.html. Canonical link: https://commits.webkit.org/169546@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-18 14:52:29 +00:00
function emptyFunc() { }
window.successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>