Remove WebRTC legacy API implementation
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2018 22:42:26 +0000 (22:42 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2018 22:42:26 +0000 (22:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189040

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/mediacapture-streams/MediaDevices-IDL-all-expected.txt:
* web-platform-tests/mediacapture-streams/MediaDevices-IDL-enumerateDevices-expected.txt:
* web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https-expected.txt:
* web-platform-tests/webrtc/historical-expected.txt:
* web-platform-tests/webrtc/no-media-call.html:
* web-platform-tests/webrtc/simplecall.https.html:

Source/WebCore:

This API is no longer needed as the runtime flag is off by default.
Removing this option allows removing some code and will ease future WebRTC improvements.
Covered by existing tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaStreamEvent.cpp: Removed.
* Modules/mediastream/MediaStreamEvent.h: Removed.
* Modules/mediastream/MediaStreamEvent.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(createOffer):
(createAnswer):
(setLocalDescription):
(setRemoteDescription):
(addIceCandidate):
(getLocalStreams): Deleted.
(getStreamById): Deleted.
(addStream): Deleted.
(): Deleted.
* Modules/mediastream/RTCPeerConnectionInternals.js:
(callbacksAndDictionaryOverload):
(if): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
(WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
(WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::isWebRTCLegacyAPIEnabled): Deleted.
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebRTCLegacyAPIEnabled): Deleted.
(WKPreferencesGetWebRTCLegacyAPIEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _webRTCLegacyAPIEnabled]): Deleted.
(-[WKPreferences _setWebRTCLegacyAPIEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webRTCLegacyAPIEnabled]): Deleted.
(-[WebPreferences setWebRTCLegacyAPIEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebRTCLegacyAPIEnabled): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* TestExpectations:
* fast/events/constructors/media-stream-event-constructor-expected.txt: Removed.
* fast/events/constructors/media-stream-event-constructor.html: Removed.
* fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-AddRemoveStream.html: Removed.
* fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
* fast/mediastream/RTCPeerConnection-createAnswer.html:
* fast/mediastream/RTCPeerConnection-createOffer-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-createOffer.html: Removed.
* fast/mediastream/RTCPeerConnection-dtmf.html: Removed.
* fast/mediastream/RTCPeerConnection-events-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-events.html: Removed.
* fast/mediastream/RTCPeerConnection-have-local-offer-expected.txt:
* fast/mediastream/RTCPeerConnection-have-local-offer.html:
* fast/mediastream/RTCPeerConnection-have-local-pranswer-expected.txt:
* fast/mediastream/RTCPeerConnection-have-local-pranswer.html:
* fast/mediastream/RTCPeerConnection-have-remote-offer-expected.txt:
* fast/mediastream/RTCPeerConnection-have-remote-offer.html:
* fast/mediastream/RTCPeerConnection-have-remote-pranswer-expected.txt:
* fast/mediastream/RTCPeerConnection-have-remote-pranswer.html:
* fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html: Removed.
* fast/mediastream/RTCPeerConnection-localDescription-expected.txt:
* fast/mediastream/RTCPeerConnection-localDescription.html:
* fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt:
* fast/mediastream/RTCPeerConnection-remoteDescription.html:
* fast/mediastream/RTCPeerConnection-stable-expected.txt:
* fast/mediastream/RTCPeerConnection-stable.html:
* fast/mediastream/RTCPeerConnection-stats.html:
* fast/mediastream/RTCPeerConnection-statsSelector-expected.txt:
* fast/mediastream/RTCPeerConnection-statsSelector.html:
* fast/mediastream/argument-types-expected.txt: Removed.
* fast/mediastream/argument-types.html: Removed.
* fast/mediastream/getusermedia-expected.txt: Removed.
* fast/mediastream/getusermedia.html: Removed.
* fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt: Removed.
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Removed.
* platform/mac/TestExpectations:
* webrtc/legacy-api-expected.txt:
* webrtc/legacy-api.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235484 268f45cc-cd09-0410-ab3c-d52691b4dbfc

97 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt [deleted file]
LayoutTests/fast/events/constructors/media-stream-event-constructor.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-dtmf.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-events-expected.txt [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-events.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-have-local-offer-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-have-local-offer.html
LayoutTests/fast/mediastream/RTCPeerConnection-have-local-pranswer-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-have-local-pranswer.html
LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-offer-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-offer.html
LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-pranswer-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-have-remote-pranswer.html
LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [deleted file]
LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html
LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
LayoutTests/fast/mediastream/RTCPeerConnection-stable-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-stable.html
LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html
LayoutTests/fast/mediastream/argument-types-expected.txt [deleted file]
LayoutTests/fast/mediastream/argument-types.html [deleted file]
LayoutTests/fast/mediastream/getusermedia-expected.txt [deleted file]
LayoutTests/fast/mediastream/getusermedia.html [deleted file]
LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt [deleted file]
LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html [deleted file]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-IDL-all-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-IDL-enumerateDevices-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.html
LayoutTests/imported/w3c/web-platform-tests/webrtc/historical-expected.txt
LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call.html
LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/webrtc/simplecall.https.html
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-wk1/TestExpectations
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/webrtc/legacy-api-expected.txt
LayoutTests/webrtc/legacy-api.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp [deleted file]
Source/WebCore/Modules/mediastream/MediaStreamEvent.h [deleted file]
Source/WebCore/Modules/mediastream/MediaStreamEvent.idl [deleted file]
Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl [deleted file]
Source/WebCore/Modules/mediastream/NavigatorUserMedia.js [deleted file]
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/RTCPeerConnection.js
Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/EventNames.in
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp

index cb38469..7ea7666 100644 (file)
@@ -1,5 +1,53 @@
 2018-08-29  Youenn Fablet  <youenn@apple.com>
 
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        * TestExpectations:
+        * fast/events/constructors/media-stream-event-constructor-expected.txt: Removed.
+        * fast/events/constructors/media-stream-event-constructor.html: Removed.
+        * fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Removed.
+        * fast/mediastream/RTCPeerConnection-AddRemoveStream.html: Removed.
+        * fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
+        * fast/mediastream/RTCPeerConnection-createAnswer.html:
+        * fast/mediastream/RTCPeerConnection-createOffer-expected.txt: Removed.
+        * fast/mediastream/RTCPeerConnection-createOffer.html: Removed.
+        * fast/mediastream/RTCPeerConnection-dtmf.html: Removed.
+        * fast/mediastream/RTCPeerConnection-events-expected.txt: Removed.
+        * fast/mediastream/RTCPeerConnection-events.html: Removed.
+        * fast/mediastream/RTCPeerConnection-have-local-offer-expected.txt:
+        * fast/mediastream/RTCPeerConnection-have-local-offer.html:
+        * fast/mediastream/RTCPeerConnection-have-local-pranswer-expected.txt:
+        * fast/mediastream/RTCPeerConnection-have-local-pranswer.html:
+        * fast/mediastream/RTCPeerConnection-have-remote-offer-expected.txt:
+        * fast/mediastream/RTCPeerConnection-have-remote-offer.html:
+        * fast/mediastream/RTCPeerConnection-have-remote-pranswer-expected.txt:
+        * fast/mediastream/RTCPeerConnection-have-remote-pranswer.html:
+        * fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt: Removed.
+        * fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html: Removed.
+        * fast/mediastream/RTCPeerConnection-localDescription-expected.txt:
+        * fast/mediastream/RTCPeerConnection-localDescription.html:
+        * fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt:
+        * fast/mediastream/RTCPeerConnection-remoteDescription.html:
+        * fast/mediastream/RTCPeerConnection-stable-expected.txt:
+        * fast/mediastream/RTCPeerConnection-stable.html:
+        * fast/mediastream/RTCPeerConnection-stats.html:
+        * fast/mediastream/RTCPeerConnection-statsSelector-expected.txt:
+        * fast/mediastream/RTCPeerConnection-statsSelector.html:
+        * fast/mediastream/argument-types-expected.txt: Removed.
+        * fast/mediastream/argument-types.html: Removed.
+        * fast/mediastream/getusermedia-expected.txt: Removed.
+        * fast/mediastream/getusermedia.html: Removed.
+        * fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt: Removed.
+        * fast/mediastream/webkitGetUserMedia-shadowing-then.html: Removed.
+        * platform/mac/TestExpectations:
+        * webrtc/legacy-api-expected.txt:
+        * webrtc/legacy-api.html:
+
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
         Add a runtime flag for WebRTC unified plan
         https://bugs.webkit.org/show_bug.cgi?id=189068
 
index a06154f..3193ba3 100644 (file)
@@ -1177,12 +1177,14 @@ webkit.org/b/172f21 imported/w3c/web-platform-tests/webrtc/getstats.html [ Failu
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ontrack.https.html [ Skip ]
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html [ Failure ]
 
+# Uses legacy WebRTC API.
+imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription.html [ Skip ]
+
 fast/mediastream/RTCPeerConnection-closed-state.html [ Skip ]
 fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Skip ]
 fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html [ Skip ]
 fast/mediastream/RTCPeerConnection-overloaded-operations-params.html [ Skip ]
 fast/mediastream/RTCRtpSender-replaceTrack.html [ Skip ]
-fast/mediastream/RTCPeerConnection-dtmf.html [ Failure ]
 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ]
 
 # Only iOS WK1 has testRunner.setPagePaused.
diff --git a/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt b/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt
deleted file mode 100644 (file)
index 2b710cd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-This tests the constructor for the MediaStreamEvent DOM class.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS new MediaStreamEvent('eventType').bubbles is false
-PASS new MediaStreamEvent('eventType').cancelable is false
-PASS new MediaStreamEvent('eventType').stream is null
-PASS new MediaStreamEvent('eventType', { bubbles: false }).bubbles is false
-PASS new MediaStreamEvent('eventType', { bubbles: true }).bubbles is true
-PASS new MediaStreamEvent('eventType', { cancelable: false }).cancelable is false
-PASS new MediaStreamEvent('eventType', { cancelable: true }).cancelable is true
-PASS new MediaStreamEvent('eventType', { stream: mediaStream }).stream is mediaStream
-PASS new MediaStreamEvent('eventType', { stream: testObject }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: document }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: undefined }).stream is null
-PASS new MediaStreamEvent('eventType', { stream: null }).stream is null
-PASS new MediaStreamEvent('eventType', { stream: false }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: true }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: '' }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: 'chocolate' }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: 12345 }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: 18446744073709551615 }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: NaN }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { stream: {valueOf: function () { return mediaStream; } } }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { get stream() { return 123; } }).stream threw exception TypeError: Type error.
-PASS new MediaStreamEvent('eventType', { get stream() { throw 'MediaStreamEvent Error'; } }) threw exception MediaStreamEvent Error.
-PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).bubbles is true
-PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).cancelable is true
-PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).stream is mediaStream
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/events/constructors/media-stream-event-constructor.html b/LayoutTests/fast/events/constructors/media-stream-event-constructor.html
deleted file mode 100644 (file)
index 01ae846..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script>
-
-description("This tests the constructor for the MediaStreamEvent DOM class.");
-
-var testObject = {nyannyan: 123};
-var mediaStream = new MediaStream();
-
-// No initializer is passed.
-shouldBe("new MediaStreamEvent('eventType').bubbles", "false");
-shouldBe("new MediaStreamEvent('eventType').cancelable", "false");
-shouldBe("new MediaStreamEvent('eventType').stream", "null");
-
-// bubbles is passed.
-shouldBe("new MediaStreamEvent('eventType', { bubbles: false }).bubbles", "false");
-shouldBe("new MediaStreamEvent('eventType', { bubbles: true }).bubbles", "true");
-
-// cancelable is passed.
-shouldBe("new MediaStreamEvent('eventType', { cancelable: false }).cancelable", "false");
-shouldBe("new MediaStreamEvent('eventType', { cancelable: true }).cancelable", "true");
-
-// stream is passed.
-// Valid object.
-shouldBe("new MediaStreamEvent('eventType', { stream: mediaStream }).stream", "mediaStream");
-
-// Invalid objects.
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: testObject }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: document }).stream", "TypeError");
-shouldBe("new MediaStreamEvent('eventType', { stream: undefined }).stream", "null");
-shouldBe("new MediaStreamEvent('eventType', { stream: null }).stream", "null");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: false }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: true }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: '' }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: 'chocolate' }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: 12345 }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: 18446744073709551615 }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: NaN }).stream", "TypeError");
-// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldThrowErrorName("new MediaStreamEvent('eventType', { stream: {valueOf: function () { return mediaStream; } } }).stream", "TypeError");
-shouldThrowErrorName("new MediaStreamEvent('eventType', { get stream() { return 123; } }).stream", "TypeError");
-shouldThrow("new MediaStreamEvent('eventType', { get stream() { throw 'MediaStreamEvent Error'; } })");
-
-// All initializers are passed.
-shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).bubbles", "true");
-shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).cancelable", "true");
-shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).stream", "mediaStream");
-</script>
-<script src="../../../resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt b/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt
deleted file mode 100644 (file)
index 12a5aa3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Tests RTCPeerConnection [add|remove]Stream.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Got a stream.
-PASS pc.addStream(null) threw exception TypeError: Argument 1 ('stream') to RTCPeerConnection.addStream must be an instance of MediaStream.
-PASS pc.getLocalStreams().length is 0
-PASS Got another stream.
-PASS stream.id === stream2.id is false
-PASS onAddStream was called.
-PASS pc.getStreamById(stream.id) is stream
-PASS pc.getStreamById(stream2.id) is null
-PASS pc.getLocalStreams().length is 1
-PASS pc.getLocalStreams().length is 1
-PASS onRemoveStream was called.
-PASS pc.getLocalStreams().length is 0
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html b/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html
deleted file mode 100644 (file)
index 6d04794..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-        <script src="./resources/getUserMedia-helper.js"></script>
-    </head>
-    <body>
-        <script>
-            description("Tests RTCPeerConnection [add|remove]Stream.");
-
-            var stream = null;
-            var stream2 = null;
-            var pc = null;
-
-            function error()
-            {
-                testFailed('Stream generation failed.');
-                finishJSTest();
-            }
-
-            function getUserMedia(dictionary, callback)
-            {
-                try {
-                    navigator.mediaDevices.getUserMedia(dictionary)
-                        .then(callback)
-                        .catch(error);
-                } catch (e) {
-                    testFailed('webkitGetUserMedia threw exception :' + e);
-                    finishJSTest();
-                }
-            }
-
-            function onErroneousNegotiationNeeded()
-            {
-                testFailed('onErroneousNegotiationNeeded was called.');
-                finishJSTest();
-            }
-
-            function onRemoveStream(event)
-            {
-                testPassed('onRemoveStream was called.');
-
-                shouldBe('pc.getLocalStreams().length', '0');
-
-                finishJSTest();
-            }
-
-            function onAddStream(event)
-            {
-                testPassed('onAddStream was called.');
-
-                shouldBe('pc.getStreamById(stream.id)', 'stream');
-                shouldBe('pc.getStreamById(stream2.id)', 'null');
-
-                pc.onnegotiationneeded = onErroneousNegotiationNeeded;
-                pc.addStream(stream);
-                shouldBe('pc.getLocalStreams().length', '1');
-                pc.removeStream(stream2);
-                shouldBe('pc.getLocalStreams().length', '1');
-
-                pc.onnegotiationneeded = onRemoveStream;
-                pc.removeStream(stream);
-            }
-
-            function gotStream2(s)
-            {
-                testPassed('Got another stream.');
-                stream2 = s;
-
-                shouldBeFalse("stream.id === stream2.id");
-
-                pc.onnegotiationneeded = onAddStream;
-                pc.addStream(stream);
-            }
-
-            function gotStream1(s)
-            {
-                testPassed('Got a stream.');
-                stream = s;
-
-                pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-                pc.onnegotiationneeded = onErroneousNegotiationNeeded;
-                shouldThrow("pc.addStream(null)");
-
-                shouldBe('pc.getLocalStreams().length', '0');
-
-                getUserMedia({audio:true, video:true}, gotStream2);
-            }
-
-            if (window.testRunner)
-                testRunner.setUserMediaPermission(true);
-            else {
-                debug("This test can not be run without the testRunner");
-                finishJSTest();
-            }
-
-            getUserMedia({audio:true, video:true}, gotStream1);
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
index 95ff8a5..f63a0a2 100644 (file)
@@ -3,7 +3,7 @@ Tests RTCPeerConnection createAnswer.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS pc.createAnswer(requestSucceeded1, requestFailed1); did not throw exception.
+PASS pc.createAnswer().then(requestSucceeded1, requestFailed1); did not throw exception.
 FAIL createAnswer request failed.
 PASS successfullyParsed is true
 
index 8274b73..e8e9c4c 100644 (file)
@@ -26,7 +26,7 @@
                 sessionDescription = sd;
                 shouldBe('sessionDescription.type', '"answer"');
 
-                shouldNotThrow('pc.createAnswer(requestSucceeded5, requestFailed1, {requestIdentity:"no"});');
+                shouldNotThrow('pc.createAnswer({requestIdentity:"no"}).then(requestSucceeded5, requestFailed1);');
             }
 
             function requestSucceeded3(sd)
@@ -37,7 +37,7 @@
                 sessionDescription = sd;
                 shouldBe('sessionDescription.type', '"answer"');
 
-                shouldNotThrow('pc.createAnswer(requestSucceeded4, requestFailed1, {requestIdentity:"yes"});');
+                shouldNotThrow('pc.createAnswer({requestIdentity:"yes"}).then(requestSucceeded4, requestFailed1);');
             }
 
             function requestFailed2(reason)
@@ -46,7 +46,7 @@
 
                 errorReason = reason;
                 shouldBe('errorReason.name', '"Invalid createAnswer argument."');
-                shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed1, {requestIdentity:"ifconfigured"});');
+                shouldNotThrow('pc.createAnswer({requestIdentity:"ifconfigured"}).then(requestSucceeded3, requestFailed1);');
             }
 
             function requestSucceeded2()
@@ -68,7 +68,7 @@
                 testPassed('createAnswer request succeeded.');
 
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"v=0\r\no=- 5667094644266930845 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionsetDescriptionSucceeded, setDescriptionFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(setDescriptionSucceeded, setDescriptionFailed);');
             }
 
             function setDescriptionFailed(message)
             function setDescriptionSucceeded()
             {
                 testPassed('setRemoteDescription succeeded.');
-                pc.createAnswer(requestSucceeded2, requestFailed2, {});
+                pc.createAnswer({}).then(requestSucceeded2, requestFailed2);
             }
 
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-            shouldNotThrow('pc.createAnswer(requestSucceeded1, requestFailed1);');
+            shouldNotThrow('pc.createAnswer().then(requestSucceeded1, requestFailed1);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt b/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt
deleted file mode 100644 (file)
index 3739292..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Tests RTCPeerConnection createOffer.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS pc.createOffer(requestSucceeded1, requestFailed1); did not throw exception.
-PASS createOffer request succeeded.
-PASS sessionDescription.type is "offer"
-FAIL pc.createOffer(requestSucceeded2, requestFailed2, {}); should throw an exception. Was [object Promise].
-FAIL createOffer request succeeded.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html b/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html
deleted file mode 100644 (file)
index 1d5e8ec..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <script>
-            description("Tests RTCPeerConnection createOffer.");
-
-            // Let's ensure built-ins are shielded from user scripts
-            var thenPromise = Promise.prototype.then;
-            Promise.prototype.then = function() {
-                console.log("Promise.prototype.then is called internally");
-                return thenPromise.apply(this, arguments);
-            }
-
-            var pc = null;
-
-            function requestSucceeded3(sd)
-            {
-                testPassed('createOffer request succeeded.');
-
-                sessionDescription = sd;
-                shouldBe('sessionDescription.type', '"offer"');
-                finishJSTest();
-            }
-
-            function requestFailed7(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:0});');
-            }
-
-            function requestFailed6(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed7, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:""});');
-            }
-
-            function requestFailed5(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed6, {requestIdentity:"yes", offerToReceiveVideo:"", offerToReceiveAudio:0});');
-            }
-
-            function requestFailed4(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed5, {offerToReceiveVideo:0, offerToReceiveAudio:0});');
-            }
-
-            function requestFailed3(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed4, {requestIdentity:"yes", offerToReceiveVideo:0});');
-            }
-
-            function requestFailed2(reason)
-            {
-                testPassed('createOffer request failed.');
-
-                errorReason = reason;
-                shouldBe('errorReason.name', '"Invalid createOffer argument."');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed3, {requestIdentity:"yes", offerToReceiveAudio:0});');
-            }
-
-            function requestSucceeded2(sd)
-            {
-                testFailed('createOffer request succeeded.');
-                finishJSTest();
-            }
-
-            function requestFailed1()
-            {
-                testFailed('createOffer request failed.');
-                finishJSTest();
-            }
-
-            function requestSucceeded1(sd)
-            {
-                testPassed('createOffer request succeeded.');
-
-                sessionDescription = sd;
-                shouldBe('sessionDescription.type', '"offer"');
-
-                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed2, {});');
-            }
-
-            pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-            shouldNotThrow('pc.createOffer(requestSucceeded1, requestFailed1);');
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-dtmf.html b/LayoutTests/fast/mediastream/RTCPeerConnection-dtmf.html
deleted file mode 100644 (file)
index ce528b4..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <script>
-            description("Tests RTCDTMFSender.");
-
-            var pc = null;
-            var stream = null;
-            var dtmfsender = null;
-
-            function error() {
-                testFailed('Error callback called.');
-                finishJSTest();
-            }
-
-            var lastCall = false;
-            var callCount = 1;
-
-            function ontonechange(e) {
-                event = e;
-                testPassed("ontonechange was called " + event.tone);
-                if (!lastCall) {
-                    callCount++;
-                    if (8 == callCount)
-                        lastCall = true;
-                } else {
-                    shouldBeEmptyString('event.tone');
-                    finishJSTest();
-                }
-            }
-
-            function pc_onicechange() {
-                if (pc.iceConnectionState === "completed") {
-                    testPassed("pc is connected");
-                    track = stream.getAudioTracks()[0];
-
-                    shouldThrow('dtmfsender = pc.createDTMFSender(track);');
-                    pc.addStream(stream);
-                    shouldNotThrow('dtmfsender = pc.createDTMFSender(track);');
-                    shouldBeTrue('dtmfsender.canInsertDTMF');
-
-                    dtmfsender.ontonechange = ontonechange;
-                    dtmfsender.insertDTMF("1");
-                    shouldBe('dtmfsender.duration', "100");
-                    shouldBe('dtmfsender.interToneGap', "70");
-
-                    dtmfsender.insertDTMF("4", "40", "30");
-                    shouldBe('dtmfsender.duration', "40");
-                    shouldBe('dtmfsender.interToneGap', "30");
-
-                    dtmfsender.insertDTMF("123", "6000");
-                    shouldBe('dtmfsender.duration', "6000");
-                    shouldBe('dtmfsender.interToneGap', "70");
-
-                    shouldThrow('dtmfsender.insertDTMF("1", "20");');
-                    shouldThrow('dtmfsender.insertDTMF("1", "7000");');
-                    shouldThrow('dtmfsender.insertDTMF("1", "70", "10");');
-
-                }
-            }
-
-            function gotStream(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '1');
-                shouldBe('stream.getVideoTracks().length', '0');
-
-                pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-                pc.oniceconnectionstatechange = pc_onicechange;
-            }
-
-            shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream, error);");
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-events-expected.txt b/LayoutTests/fast/mediastream/RTCPeerConnection-events-expected.txt
deleted file mode 100644 (file)
index 091cb7d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Tests that RTCPeerConnection event callbacks are async so that for example close can be called safely. The order of the messages is very important.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-FAIL webkitGetUserMedia threw exception :TypeError: navigator.webkitGetUserMedia is not a function. (In 'navigator.webkitGetUserMedia(dictionary, callback, error)', 'navigator.webkitGetUserMedia' is undefined)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-events.html b/LayoutTests/fast/mediastream/RTCPeerConnection-events.html
deleted file mode 100644 (file)
index 96e58d9..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <script>
-            description("Tests that RTCPeerConnection event callbacks are async so that for example close can be called safely. The order of the messages is very important.");
-
-            var stream = null;
-            var pc = null;
-
-            function error() {
-                testFailed('Stream generation failed.');
-                finishJSTest();
-            }
-
-            function getUserMedia(dictionary, callback) {
-                try {
-                    navigator.webkitGetUserMedia(dictionary, callback, error);
-                } catch (e) {
-                    testFailed('webkitGetUserMedia threw exception :' + e);
-                    finishJSTest();
-                }
-            }
-
-            function onStateChange(event) {
-                testPassed('onStateChange was called.');
-                shouldBe("pc.signalingState", "'closed'");
-                finishJSTest();
-            }
-
-            function onNegotiationNeeded(event) {
-                testPassed('onNegotiationNeeded was called.');
-                pc.onsignalingstatechange = onStateChange;
-                pc.close();
-                testPassed('onNegotiationNeeded done.')
-            }
-
-            function gotStream(s) {
-                testPassed('gotStream was called.');
-                stream = s;
-
-                pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-                pc.onnegotiationneeded = onNegotiationNeeded;
-
-                pc.addStream(stream);
-                testPassed('gotStream done.');
-            }
-
-            getUserMedia({audio:true, video:true}, gotStream);
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
index 01b1b84..a015684 100644 (file)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc.signalingState is "stable"
-PASS pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed); did not throw exception.
 FAIL setRemoteDescription failed.
 PASS successfullyParsed is true
 
index dea481d..530de6e 100644 (file)
@@ -21,7 +21,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded5, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded5, finishIfFailed);');
             }
 
             function requestSucceeded3()
@@ -31,7 +31,7 @@
                 pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded4, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded4, finishIfFailed);');
             }
 
             function requestSucceeded2()
@@ -39,7 +39,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded3, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded3, finishIfFailed);');
             }
 
             function requestFailed3(reason)
@@ -49,7 +49,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded2, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded2, finishIfFailed);');
             }
 
             function requestFailed2(reason)
@@ -59,7 +59,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed3);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3);');
             }
 
             function requestFailed1(reason)
@@ -69,7 +69,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed2);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed2);');
             }
 
             function requestSucceeded1()
@@ -77,7 +77,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed1);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1);');
             }
 
             function finishIfSucceeded()
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             shouldBe('pc.signalingState', '"stable"');
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-            shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed);');
+            shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
index 1b011d1..fa7dfa2 100644 (file)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc.signalingState is "stable"
-PASS pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, finishIfFailed); did not throw exception.
+PASS pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, finishIfFailed); did not throw exception.
 FAIL setRemoteDescription failed.
 PASS successfullyParsed is true
 
index 4825bd4..cf45f5a 100644 (file)
@@ -23,7 +23,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded4, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded4, finishIfFailed);');
             }
 
             function requestFailed3(reason)
@@ -33,7 +33,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed4);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed4);');
             }
 
             function requestFailed2(reason)
@@ -43,7 +43,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed3);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3);');
             }
 
             function requestFailed1(reason)
@@ -53,7 +53,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed2);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed2);');
             }
 
             function requestSucceeded3()
@@ -61,7 +61,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed1);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1);');
             }
 
             function requestSucceeded2()
@@ -69,7 +69,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("pranswer", "local", "offer", "remote", '"have-local-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded3, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded3, finishIfFailed);');
             }
 
             function requestSucceeded1()
@@ -77,7 +77,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded2, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded2, finishIfFailed);');
             }
 
             function finishIfSucceeded()
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             shouldBe('pc.signalingState', '"stable"');
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-            shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, finishIfFailed);');
+            shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, finishIfFailed);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
index 37c50e3..ff4f24d 100644 (file)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc.signalingState is "stable"
-PASS pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, finishIfFailed); did not throw exception.
+PASS pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, finishIfFailed); did not throw exception.
 FAIL setRemoteDescription failed.
 PASS successfullyParsed is true
 
index fd5bf88..2f5637c 100644 (file)
@@ -21,7 +21,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded5, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded5, finishIfFailed);');
             }
 
             function requestSucceeded3()
@@ -31,7 +31,7 @@
                 pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded4, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded4, finishIfFailed);');
             }
 
             function requestSucceeded2()
@@ -39,7 +39,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded3, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded3, finishIfFailed);');
             }
 
             function requestFailed3(reason)
@@ -49,7 +49,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded2, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded2, finishIfFailed);');
             }
 
             function requestFailed2(reason)
@@ -59,7 +59,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed3);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3);');
             }
 
             function requestFailed1(reason)
@@ -69,7 +69,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed2);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed2);');
             }
 
             function requestSucceeded1()
@@ -77,7 +77,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("", "", "offer", "remote", '"have-remote-offer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed1);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1);');
             }
 
             function finishIfSucceeded()
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             shouldBe('pc.signalingState', '"stable"');
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-            shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, finishIfFailed);');
+            shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, finishIfFailed);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
index 1cfd6bd..17a59b2 100644 (file)
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc.signalingState is "stable"
-PASS pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed); did not throw exception.
 FAIL setRemoteDescription failed.
 PASS successfullyParsed is true
 
index df3de00..2ccc1f0 100644 (file)
@@ -23,7 +23,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded4, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded4, finishIfFailed);');
             }
 
             function requestFailed3(reason)
@@ -33,7 +33,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed4);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed4);');
             }
 
             function requestFailed2(reason)
@@ -43,7 +43,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed3);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed3);');
             }
 
             function requestFailed1(reason)
@@ -53,7 +53,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed2);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed2);');
             }
 
             function requestSucceeded3()
@@ -61,7 +61,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed1);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed1);');
             }
 
             function requestSucceeded2()
@@ -69,7 +69,7 @@
                 testPassed('setRemoteDescription succeeded.');
                 check("offer", "local", "pranswer", "remote", '"have-remote-pranswer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded3, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded3, finishIfFailed);');
             }
 
             function requestSucceeded1()
@@ -77,7 +77,7 @@
                 testPassed('setLocalDescription succeeded.');
                 check("offer", "local", "", "", '"have-local-offer"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded2, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded2, finishIfFailed);');
             }
 
             function finishIfSucceeded()
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             shouldBe('pc.signalingState', '"stable"');
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-            shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed);');
+            shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt b/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt
deleted file mode 100644 (file)
index a8d8117..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-Test RTCPeerConnection's legacy MediaStream-based API
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Stream sets should be empty initially
-PASS pc.getLocalStreams().length is 0
-PASS pc.getRemoteStreams().length is 0
-
-Test with single track MediaStream
-audioTrack = stream.getAudioTracks()[0]
-PASS pc.addStream(stream) did not throw exception.
-PASS pc.getLocalStreams().length is 1
-PASS pc.getLocalStreams()[0] is stream
-PASS pc.getStreamById(stream.id) is stream
-PASS pc.getSenders().length is 1
-PASS pc.getSenders()[0].track is audioTrack
-Adding the same stream again should be a no-op
-PASS pc.addStream(stream) did not throw exception.
-PASS pc.getLocalStreams().length is 1
-
-Test with audio and video MediaStream
-audioTrack = stream.getAudioTracks()[0]
-videoTrack = stream.getVideoTracks()[0]
-PASS pc.addStream(stream) did not throw exception.
-PASS pc.getLocalStreams().length is 2
-PASS pc.getLocalStreams().includes(stream) is true
-PASS pc.getStreamById(stream.id) is stream
-PASS pc.getSenders().length is 3
-PASS audioTrackFoundAmongSenders is true
-PASS videoTrackFoundAmongSenders is true
-
-Test removeStream
-Remove a non-existent stream
-otherStream = stream.clone()
-PASS pc.removeStream(otherStream) did not throw exception.
-Both streams should still be present
-PASS pc.getLocalStreams().length is 2
-PASS pc.removeStream(stream) did not throw exception.
-PASS pc.getLocalStreams().length is 1
-PASS pc.getStreamById(stream.id) is null
-All senders should still be present
-PASS pc.getSenders().length is 3
-Removing the same stream again should be a no-op
-PASS pc.removeStream(stream) did not throw exception.
-PASS pc.getLocalStreams().length is 1
-
-Test applying a remote description offering a stream with two tracks
-Create remote offer
-Got remote offer, set it
-Remote offer set
-PASS End of test promise chain
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html b/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html
deleted file mode 100644 (file)
index 7a21156..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <script>
-            if (window.internals)
-                internals.useMockRTCPeerConnectionFactory("");
-
-            description("Test RTCPeerConnection's legacy MediaStream-based API");
-
-            let stream;
-            let otherStream;
-            let audioTrack;
-            let videoTrack;
-            let audioTrackFoundAmongSenders;
-            let videoTrackFoundAmongSenders;
-            let remoteStream;
-
-            if (window.testRunner)
-                testRunner.setUserMediaPermission(true);
-            else {
-                debug("This test can not be run without the testRunner");
-                finishJSTest();
-            }
-
-            const pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-            const remotePc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
-
-            debug("Stream sets should be empty initially")
-            shouldBe("pc.getLocalStreams().length", "0");
-            shouldBe("pc.getRemoteStreams().length", "0");
-
-            pc.onaddstream = evt => {
-                testPassed("Got 'addstream' event (before setRemoteDescription promise fulfilled)");
-                remoteStream = evt.stream;
-
-                shouldBe("remoteStream.getTracks().length", "2");
-
-                shouldBe("pc.getRemoteStreams().length", "1");
-                shouldBe("pc.getRemoteStreams()[0]", "remoteStream");
-
-                shouldBe("pc.getStreamById(remoteStream.id)", "remoteStream");
-            };
-
-            navigator.mediaDevices.getUserMedia({ "audio": true })
-            .then(s => {
-                stream = s;
-
-                debug("<br>Test with single track MediaStream");
-                evalAndLog("audioTrack = stream.getAudioTracks()[0]");
-                shouldNotThrow("pc.addStream(stream)");
-
-                shouldBe("pc.getLocalStreams().length", "1");
-                shouldBe("pc.getLocalStreams()[0]", "stream");
-
-                shouldBe("pc.getStreamById(stream.id)", "stream");
-
-                shouldBe("pc.getSenders().length", "1");
-                shouldBe("pc.getSenders()[0].track", "audioTrack");
-
-                debug("Adding the same stream again should be a no-op");
-                shouldNotThrow("pc.addStream(stream)");
-                shouldBe("pc.getLocalStreams().length", "1");
-
-                return navigator.mediaDevices.getUserMedia({ "audio": true, "video": true });
-            })
-            .then(s => {
-                stream = s;
-
-                debug("<br>Test with audio and video MediaStream");
-                evalAndLog("audioTrack = stream.getAudioTracks()[0]");
-                evalAndLog("videoTrack = stream.getVideoTracks()[0]");
-
-                shouldNotThrow("pc.addStream(stream)");
-
-                shouldBe("pc.getLocalStreams().length", "2");
-                shouldBeTrue("pc.getLocalStreams().includes(stream)");
-
-                shouldBe("pc.getStreamById(stream.id)", "stream");
-
-                shouldBe("pc.getSenders().length", "3");
-
-                audioTrackFoundAmongSenders = false;
-                videoTrackFoundAmongSenders = false;
-                pc.getSenders().forEach(sender => {
-                    if (sender.track === audioTrack)
-                        audioTrackFoundAmongSenders = true;
-                    else if (sender.track === videoTrack)
-                        videoTrackFoundAmongSenders = true;
-                });
-
-                shouldBeTrue("audioTrackFoundAmongSenders");
-                shouldBeTrue("videoTrackFoundAmongSenders");
-
-                debug("<br>Test removeStream");
-                debug("Remove a non-existent stream");
-                evalAndLog("otherStream = stream.clone()");
-                shouldNotThrow("pc.removeStream(otherStream)");
-
-                debug("Both streams should still be present");
-                shouldBe("pc.getLocalStreams().length", "2");
-
-                shouldNotThrow("pc.removeStream(stream)");
-
-                shouldBe("pc.getLocalStreams().length", "1");
-                shouldBe("pc.getStreamById(stream.id)", "null");
-
-                debug("All senders should still be present")
-                shouldBe("pc.getSenders().length", "3");
-
-                debug("Removing the same stream again should be a no-op");
-                shouldNotThrow("pc.removeStream(stream)");
-                shouldBe("pc.getLocalStreams().length", "1");
-
-                debug("<br>Test applying a remote description offering a stream with two tracks");
-                remotePc.addStream(stream);
-
-                debug("Create remote offer");
-                return remotePc.createOffer();
-            })
-            .then(remoteOffer => {
-                debug("Got remote offer, set it");
-                return pc.setRemoteDescription(remoteOffer);
-            })
-            .then(() => {
-                debug("Remote offer set");
-                testPassed("End of test promise chain");
-                debug("");
-
-                finishJSTest();
-            })
-            .catch(error => {
-                testFailed("Error in promise chain: " + error);
-                finishJSTest();
-            });
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
index 6302751..cbea3db 100644 (file)
@@ -3,7 +3,7 @@ Tests RTCPeerConnection localDescription.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS pc.setLocalDescription(sessionDescriptionrequestSucceeded1, requestFailed1); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(requestSucceeded1, requestFailed1); did not throw exception.
 FAIL requestFailed was called.
 PASS successfullyParsed is true
 
index 13ce481..3211d0d 100644 (file)
                 testPassed('requestSucceeded was called.');
 
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded2, requestFailed2);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded2, requestFailed2);');
             }
 
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-            shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded1, requestFailed1);');
+            shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, requestFailed1);');
 
 
             window.jsTestIsAsync = true;
index 462512f..72ce19b 100644 (file)
@@ -3,7 +3,7 @@ Tests RTCPeerConnection remoteDescription.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, requestFailed1); did not throw exception.
+PASS pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, requestFailed1); did not throw exception.
 FAIL requestFailed was called.
 PASS successfullyParsed is true
 
index dfefb22..aeb67c2 100644 (file)
                 testPassed('requestSucceeded was called.');
 
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded2, requestFailed2);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded2, requestFailed2);');
             }
 
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-            shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded1, requestFailed1);');
+            shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded1, requestFailed1);');
 
 
             window.jsTestIsAsync = true;
index 45edeb2..4dad6c7 100644 (file)
@@ -4,31 +4,31 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc.signalingState is "stable"
-PASS pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed1); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1); did not throw exception.
 PASS setLocalDescription failed.
 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
 FAIL pc.localDescription should throw an exception. Was null.
 FAIL pc.remoteDescription should throw an exception. Was null.
 PASS pc.signalingState is "stable"
-PASS pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed2); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed2); did not throw exception.
 PASS setLocalDescription failed.
 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
 FAIL pc.localDescription should throw an exception. Was null.
 FAIL pc.remoteDescription should throw an exception. Was null.
 PASS pc.signalingState is "stable"
-PASS pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed3); did not throw exception.
+PASS pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3); did not throw exception.
 PASS setRemoteDescription failed.
 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
 FAIL pc.localDescription should throw an exception. Was null.
 FAIL pc.remoteDescription should throw an exception. Was null.
 PASS pc.signalingState is "stable"
-PASS pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed4); did not throw exception.
+PASS pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed4); did not throw exception.
 PASS setRemoteDescription failed.
 FAIL errorReason.name should be InvalidSessionDescriptionError. Was InvalidStateError.
 FAIL pc.localDescription should throw an exception. Was null.
 FAIL pc.remoteDescription should throw an exception. Was null.
 PASS pc.signalingState is "stable"
-PASS pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed); did not throw exception.
+PASS pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed); did not throw exception.
 FAIL setRemoteDescription failed.
 PASS successfullyParsed is true
 
index 7daa82f..959cb0d 100644 (file)
@@ -9,13 +9,6 @@
 
             var pc = null;
 
-            // Let's ensure built-ins are shielded from user scripts
-            var thenPromise = Promise.prototype.then;
-            Promise.prototype.then = function() {
-                console.log("Promise.prototype.then is called internally");
-                return thenPromise.apply(this, arguments);
-            }
-
             function requestSucceeded2()
             {
                 testPassed('setRemoteDescription succeeded.');
@@ -30,7 +23,7 @@
                 pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionrequestSucceeded2, finishIfFailed);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded2, finishIfFailed);');
             }
 
             function requestFailed4(reason)
@@ -40,7 +33,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionrequestSucceeded1, finishIfFailed);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, finishIfFailed);');
             }
 
             function requestFailed3(reason)
@@ -50,7 +43,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed4);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed4);');
             }
 
             function requestFailed2(reason)
@@ -60,7 +53,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"remote"});
-                shouldNotThrow('pc.setRemoteDescription(sessionDescriptionfinishIfSucceeded, requestFailed3);');
+                shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(finishIfSucceeded, requestFailed3);');
             }
 
             function requestFailed1(reason)
@@ -70,7 +63,7 @@
                 shouldBe('errorReason.name', '"InvalidSessionDescriptionError"');
                 check("", "", "", "", '"stable"');
                 sessionDescription = new RTCSessionDescription({type:"pranswer", sdp:"local"});
-                shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed2);');
+                shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed2);');
             }
 
             function finishIfSucceeded()
             pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
             shouldBe('pc.signalingState', '"stable"');
             var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"local"});
-            shouldNotThrow('pc.setLocalDescription(sessionDescriptionfinishIfSucceeded, requestFailed1);');
+            shouldNotThrow('pc.setLocalDescription(sessionDescription).then(finishIfSucceeded, requestFailed1);');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
index 3c46fb2..f582939 100644 (file)
                 shouldBeNonNull('status');
                 result = status.result();
                 shouldBe('result.length', '0');
-                shouldNotThrow('getUserMedia({audio:true, video:true}gotStream)');
+                shouldNotThrow('getUserMedia({audio:true, video:true}).then(gotStream)');
             }
 
             function gotStream(s) {
                 testPassed('Got a stream.');
                 stream = s;
 
-                pc.addStream(stream);
+                pc.addTrack(stream.getVideoTracks()[0]);
                 // FIXME: Test getStats error callback: https://webkit.org/b/129860
                 shouldNotThrow('pc.getStats().then(statsHandler2, statsError)');
             }
index 6545895..59cd63e 100644 (file)
@@ -4,8 +4,12 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}) did not throw exception.
-FAIL webkitGetUserMedia threw exception :TypeError: navigator.webkitGetUserMedia is not a function. (In 'navigator.webkitGetUserMedia(dictionary, callback, error)', 'navigator.webkitGetUserMedia' is undefined)
-PASS getUserMedia({audio:true, video:true}, gotStream) did not throw exception.
+PASS navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(gotStream, error) did not throw exception.
+PASS Got a stream.
+PASS statsHandler2 was called
+PASS result.size is >= 1
+PASS timestamp is >= startTime
+FAIL local.type should be video. Was certificate.
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 60e2009..f658f3e 100644 (file)
                 finishJSTest();
             }
 
-            function getUserMedia(dictionary, callback) {
-                try {
-                    navigator.webkitGetUserMedia(dictionary, callback, error);
-                } catch (e) {
-                    testFailed('webkitGetUserMedia threw exception :' + e);
-                    finishJSTest();
-                }
-            }
-
             function error() {
                 testFailed('Stream generation failed.');
                 finishJSTest();
             }
 
-            function gotStream(s) {
+            async function gotStream(s) {
                 testPassed('Got a stream.');
                 stream = s;
 
-                pc.addStream(stream);
+                const sender = pc.addTrack(stream.getVideoTracks()[0], stream);
+                var offer = await pc.createOffer();
+                await pc.setLocalDescription(offer);
                 // FIXME: Test getStats error callback: https://webkit.org/b/129860
-                shouldNotThrow('pc.getStats(pc.getLocalStreams()[0].getVideoTracks()[0]).then(statsHandler2, statsError)');
+                pc.getStats(sender.track).then(statsHandler2, statsError);
             }
 
-            function statsHandler2(status)
+            function statsHandler2(r)
             {
+                result = r;
                 testPassed("statsHandler2 was called");
-                result = status.result();
-                shouldBeGreaterThanOrEqual('result.length', '1');
-                local = result[0].local;
+                shouldBeGreaterThanOrEqual('result.size', '1');
+                local = result.get(result.keys().next().value);
                 timestamp = local.timestamp;
                 shouldBeGreaterThanOrEqual('timestamp', 'startTime');
-                shouldBe('local.stat("type")', '"video"');
+                shouldBe('local.type', '"video"');
                 finishJSTest();
             }
 
             var startTime = new Date().getTime();
             shouldNotThrow("pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]})");
-            shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)');
+            shouldNotThrow('navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(gotStream, error)');
 
             window.jsTestIsAsync = true;
             window.successfullyParsed = true;
diff --git a/LayoutTests/fast/mediastream/argument-types-expected.txt b/LayoutTests/fast/mediastream/argument-types-expected.txt
deleted file mode 100644 (file)
index de8e2cf..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-Tests the acceptable types for arguments to navigator.getUserMedia methods.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS navigator.getUserMedia() threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(null) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({ }) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(true) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(42) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(-Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(undefined, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(null, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({ }, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(true, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(42, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(-Infinity, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia(emptyFunction, emptyFunction) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, "foobar") threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, undefined) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, null) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, {}) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, true) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, 42) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({video: true}, -Infinity) threw exception TypeError: Not enough arguments.
-PASS navigator.getUserMedia({ }, emptyFunction, emptyFunction) did not throw exception.
-PASS navigator.getUserMedia({video: true}, emptyFunction, emptyFunction) did not throw exception.
-PASS navigator.getUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:true}, emptyFunction, undefined) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/argument-types.html b/LayoutTests/fast/mediastream/argument-types.html
deleted file mode 100644 (file)
index 06828a7..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <script>
-        description("Tests the acceptable types for arguments to navigator.getUserMedia methods.");
-        
-        function test(expression, expressionShouldThrow, expectedException) {
-            if (expressionShouldThrow) {
-                if (expectedException)
-                    shouldThrow(expression, '"' + expectedException + '"');
-                else
-                    shouldThrow(expression, '"TypeError: Not enough arguments"');
-            } else {
-                shouldNotThrow(expression);
-            }
-        }
-        
-        var errorCallbackError = new TypeError("Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function")
-        var invalidDictionaryError = new TypeError('First argument of getUserMedia must be a valid Dictionary')
-        var notSupportedError = new Error('NotSupportedError: DOM Exception 9');
-        var successCallbackError = new TypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function")
-        var typeError = new TypeError('Type error');
-        var typeNotAnObjectError = new TypeError('Not an object.');
-        
-        var emptyFunction = function() {};
-        
-        // No arguments
-        test('navigator.getUserMedia()', true);
-        
-        // 1 Argument (Navigtor.getUserMedia requires at least 3 arguments).
-        test('navigator.getUserMedia(undefined)', true);
-        test('navigator.getUserMedia(null)', true);
-        test('navigator.getUserMedia({ })', true);
-        test('navigator.getUserMedia({video: true})', true);
-        test('navigator.getUserMedia(true)', true);
-        test('navigator.getUserMedia(42)', true);
-        test('navigator.getUserMedia(Infinity)', true);
-        test('navigator.getUserMedia(-Infinity)', true);
-        test('navigator.getUserMedia(emptyFunction)', true);
-        
-        // 2 Arguments.
-        test('navigator.getUserMedia({video: true}, emptyFunction)', true);
-        test('navigator.getUserMedia(undefined, emptyFunction)', true);
-        test('navigator.getUserMedia(null, emptyFunction)', true);
-        test('navigator.getUserMedia({ }, emptyFunction)', true);
-        test('navigator.getUserMedia(true, emptyFunction)', true);
-        test('navigator.getUserMedia(42, emptyFunction)', true);
-        test('navigator.getUserMedia(Infinity, emptyFunction)', true);
-        test('navigator.getUserMedia(-Infinity, emptyFunction)', true);
-        test('navigator.getUserMedia(emptyFunction, emptyFunction)', true);
-        test('navigator.getUserMedia({video: true}, "foobar")', true);
-        test('navigator.getUserMedia({video: true}, undefined)', true);
-        test('navigator.getUserMedia({video: true}, null)', true);
-        test('navigator.getUserMedia({video: true}, {})', true);
-        test('navigator.getUserMedia({video: true}, true)', true);
-        test('navigator.getUserMedia({video: true}, 42)', true);
-        test('navigator.getUserMedia({video: true}, Infinity)', true);
-        test('navigator.getUserMedia({video: true}, -Infinity)', true);
-        
-        // 3 Arguments.
-        test('navigator.getUserMedia({ }, emptyFunction, emptyFunction)', false);
-        test('navigator.getUserMedia({video: true}, emptyFunction, emptyFunction)', false);
-        test('navigator.getUserMedia({video: true}, emptyFunction, undefined)', true, errorCallbackError);
-        test('navigator.getUserMedia({audio:true, video:true}, emptyFunction, undefined)', true, errorCallbackError);
-        test('navigator.getUserMedia({audio:true}, emptyFunction, undefined)', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, "video")', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, null)', true, errorCallbackError );
-        test('navigator.getUserMedia({video: true}, emptyFunction, {})', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, true)', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, 42)', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, Infinity)', true, errorCallbackError);
-        test('navigator.getUserMedia({video: true}, emptyFunction, -Infinity)', true, errorCallbackError);
-        
-        window.jsTestIsAsync = false;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
diff --git a/LayoutTests/fast/mediastream/getusermedia-expected.txt b/LayoutTests/fast/mediastream/getusermedia-expected.txt
deleted file mode 100644 (file)
index f8383b8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-Tests getUserMedia.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS navigator.getUserMedia({audio:false, video:false}, error, expectedError); did not throw exception.
-PASS navigator.getUserMedia({audio:false, video:false}, error, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:true}, gotStream1, error); did not throw exception.
-PASS Error callback called.
-PASS Stream generated.
-PASS stream.getAudioTracks().length is 1
-PASS stream.getVideoTracks().length is 0
-PASS navigator.getUserMedia({video:true}, gotStream2, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({video:true}, gotStream2, error); did not throw exception.
-PASS Stream generated.
-PASS stream.getAudioTracks().length is 0
-PASS stream.getVideoTracks().length is 1
-PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:true, video:true}, gotStream3, error); did not throw exception.
-PASS Stream generated.
-PASS stream.getAudioTracks().length is 1
-PASS stream.getVideoTracks().length is 1
-PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:{}, video:true}, gotStream4, error); did not throw exception.
-PASS Stream generated.
-PASS stream.getAudioTracks().length is 1
-PASS stream.getVideoTracks().length is 1
-PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1); did not throw exception.
-PASS Error callback called.
-FAIL errorArg.name should be OverconstrainedError. Was Error.
-PASS errorArg.message is "Invalid constraint"
-PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0); threw exception TypeError: Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function.
-PASS navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error); did not throw exception.
-PASS Stream generated.
-PASS stream.getAudioTracks().length is 1
-PASS stream.getVideoTracks().length is 1
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/getusermedia.html b/LayoutTests/fast/mediastream/getusermedia.html
deleted file mode 100644 (file)
index 1962a10..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-    <head>
-        <script src="../../resources/js-test-pre.js"></script>
-    </head>
-    <body>
-        <p id="description"></p>
-        <div id="console"></div>
-        <script>
-            description("Tests getUserMedia.");
-
-            function setUserMediaPermission(isGranted) {
-                if (window.testRunner)
-                    testRunner.setUserMediaPermission(isGranted);
-                else
-                    debug("This test can not be run without the testRunner");
-            }
-
-            var stream;
-            var errorArg;
-
-            function error() {
-                testFailed('Error callback called.');
-                finishJSTest();
-            }
-
-            function expectedError() {
-                testPassed('Error callback called.');
-            }
-
-            function gotStreamInError(s) {
-                testFailed('Stream generated.');
-                finishJSTest();
-            }
-
-            function gotStream5(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '1');
-                shouldBe('stream.getVideoTracks().length', '1');
-                finishJSTest();
-            }
-
-            function error1(e) {
-                errorArg = e;
-                testPassed('Error callback called.');
-                shouldBeEqualToString('errorArg.name', 'OverconstrainedError');
-                shouldBeEqualToString('errorArg.message', 'Invalid constraint');
-
-                shouldThrow("navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, 0);");
-                shouldNotThrow("navigator.getUserMedia({audio:{volume:{exact:1}}, video:true}, gotStream5, error);");
-            }
-
-            function gotStream4(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '1');
-                shouldBe('stream.getVideoTracks().length', '1');
-
-                shouldThrow("navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, null);");
-                shouldNotThrow("navigator.getUserMedia({audio:true, video:{width:{exact:11}}}, gotStreamInError, error1);");
-            }
-
-            function gotStream3(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '1');
-                shouldBe('stream.getVideoTracks().length', '1');
-
-                shouldThrow("navigator.getUserMedia({audio:{}, video:true}, gotStream4, null);");
-                shouldNotThrow("navigator.getUserMedia({audio:{}, video:true}, gotStream4, error);");
-            }
-
-            function gotStream2(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '0');
-                shouldBe('stream.getVideoTracks().length', '1');
-
-                shouldThrow("navigator.getUserMedia({audio:true, video:true}, gotStream3, null);");
-                shouldNotThrow("navigator.getUserMedia({audio:true, video:true}, gotStream3, error);");
-            }
-
-            function gotStream1(s) {
-                stream = s;
-                testPassed('Stream generated.');
-                shouldBe('stream.getAudioTracks().length', '1');
-                shouldBe('stream.getVideoTracks().length', '0');
-
-                shouldThrow("navigator.getUserMedia({video:true}, gotStream2, null);")
-                shouldNotThrow("navigator.getUserMedia({video:true}, gotStream2, error);")
-            }
-
-            shouldNotThrow("navigator.getUserMedia({audio:false, video:false}, error, expectedError);")
-            shouldThrow("navigator.getUserMedia({audio:false, video:false}, error, null);")
-
-            setUserMediaPermission(true);
-            shouldNotThrow("navigator.getUserMedia({audio:true}, gotStream1, error);");
-
-            window.jsTestIsAsync = true;
-            window.successfullyParsed = true;
-        </script>
-        <script src="../../resources/js-test-post.js"></script>
-    </body>
-</html>
diff --git a/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt b/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then-expected.txt
deleted file mode 100644 (file)
index 7ef22e9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html b/LayoutTests/fast/mediastream/webkitGetUserMedia-shadowing-then.html
deleted file mode 100644 (file)
index f72a6d6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Shadowing then()</title>
-</head>
-<body>
-<!--
-This test verifies that the implementation of navigator.getUserMedia does not use public promise APIs.
--->
-<p id="output"></p>
-<script>
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-    function endTest(testStatus) {
-        document.getElementById("output").textContent = testStatus;
-        testRunner.notifyDone();
-    }
-
-    // Shadow Promise.prototype.then
-    Promise.prototype.then = (function () {
-        const realThen = Promise.prototype.then;
-        return function () {
-            endTest("FAIL: Executed shadowed, public .then()");
-        }
-    })();
-
-    function gotUserMedia(mediaStream) {
-        endTest("FAIL: Got user media");
-    }
-
-    function userMediaError(error) {
-        endTest("PASS");
-    }
-
-    var options = { audio: false, video: false };
-    navigator.getUserMedia(options, gotUserMedia, userMediaError);
-
-</script>
-</body>
-</html>
index 81b6580..01426a1 100644 (file)
@@ -1,5 +1,19 @@
 2018-08-29  Youenn Fablet  <youenn@apple.com>
 
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        * web-platform-tests/mediacapture-streams/MediaDevices-IDL-all-expected.txt:
+        * web-platform-tests/mediacapture-streams/MediaDevices-IDL-enumerateDevices-expected.txt:
+        * web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https-expected.txt:
+        * web-platform-tests/webrtc/historical-expected.txt:
+        * web-platform-tests/webrtc/no-media-call.html:
+        * web-platform-tests/webrtc/simplecall.https.html:
+
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
         Add a runtime flag for WebRTC unified plan
         https://bugs.webkit.org/show_bug.cgi?id=189068
 
index 7ca324c..1700676 100644 (file)
@@ -8,11 +8,11 @@ This test checks for the presence of the navigator.mediaDevices.getUserMedia met
 PASS Test driver 
 PASS Navigator interface: attribute mediaDevices 
 PASS Unscopable handled correctly for mediaDevices property on Navigator 
-PASS Navigator interface: operation getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) 
+FAIL Navigator interface: operation getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) assert_own_property: interface prototype object missing non-static operation expected property "getUserMedia" missing
 PASS Unscopable handled correctly for getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) on Navigator 
 PASS Navigator interface: navigator must inherit property "mediaDevices" with the proper type 
-PASS Navigator interface: navigator must inherit property "getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback)" with the proper type 
-PASS Navigator interface: calling getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) on navigator with too few arguments must throw TypeError 
+FAIL Navigator interface: navigator must inherit property "getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback)" with the proper type assert_inherits: property "getUserMedia" not found in prototype chain
+FAIL Navigator interface: calling getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) on navigator with too few arguments must throw TypeError assert_inherits: property "getUserMedia" not found in prototype chain
 PASS MediaStream interface: existence and properties of interface object 
 PASS MediaStream interface object length 
 PASS MediaStream interface object name 
index 06bb27a..9c7dbe4 100644 (file)
@@ -8,7 +8,7 @@ This test checks for the presence of the navigator.mediaDevices.enumerateDevices
 PASS Test MediaDevices.enumerateDevices call and result. Types only. 
 PASS Navigator interface: attribute mediaDevices 
 PASS Unscopable handled correctly for mediaDevices property on Navigator 
-PASS Navigator interface: operation getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) 
+FAIL Navigator interface: operation getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) assert_own_property: interface prototype object missing non-static operation expected property "getUserMedia" missing
 PASS Unscopable handled correctly for getUserMedia(MediaStreamConstraints, NavigatorUserMediaSuccessCallback, NavigatorUserMediaErrorCallback) on Navigator 
 FAIL MediaStream interface: existence and properties of interface object undefined is not an object (evaluating 'this.array
                      .members[this.base]
index c7393c4..e57491d 100644 (file)
@@ -1,10 +1,10 @@
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
-CONSOLE MESSAGE: line 1: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
+CONSOLE MESSAGE: line 16: The top-level frame has prevented a document with a different security origin to call getUserMedia.
 
 
 PASS Default "microphone" feature policy ["self"] allows the top-level document. 
index f0f07da..21e3f5b 100644 (file)
@@ -13,7 +13,7 @@
   // mic/camera has been explicitly allowed by feature policy.
   function promise_factory(allowed_features) {
     return new Promise((resolve, reject) => {
-      navigator.getUserMedia({video: true, audio: true},
+      navigator.mediaDevices.getUserMedia({video: true, audio: true}).then(
           function(stream) {
             // If microphone is allowed, there should be at least one microphone
             // in the result. If camera is allowed, there should be at least one
index d20b397..23219c7 100644 (file)
@@ -1,13 +1,13 @@
 
 PASS RTCDataChannel member reliable should not exist 
-FAIL RTCPeerConnection member addStream should not exist assert_false: expected false got true
+PASS RTCPeerConnection member addStream should not exist 
 PASS RTCPeerConnection member createDTMFSender should not exist 
-FAIL RTCPeerConnection member getLocalStreams should not exist assert_false: expected false got true
-FAIL RTCPeerConnection member getRemoteStreams should not exist assert_false: expected false got true
-FAIL RTCPeerConnection member getStreamById should not exist assert_false: expected false got true
-FAIL RTCPeerConnection member onaddstream should not exist assert_false: expected false got true
+PASS RTCPeerConnection member getLocalStreams should not exist 
+PASS RTCPeerConnection member getRemoteStreams should not exist 
+PASS RTCPeerConnection member getStreamById should not exist 
+PASS RTCPeerConnection member onaddstream should not exist 
 PASS RTCPeerConnection member onremovestream should not exist 
-FAIL RTCPeerConnection member removeStream should not exist assert_false: expected false got true
+PASS RTCPeerConnection member removeStream should not exist 
 PASS RTCPeerConnection member updateIce should not exist 
 PASS DataChannel interface should not exist 
 PASS mozRTCIceCandidate interface should not exist 
index c4979e8..c973932 100644 (file)
@@ -37,9 +37,9 @@ This test uses the legacy callback API with no media, and thus does not require
     var parsedOffer = new RTCSessionDescription({ type: 'offer',
                                                   sdp: offerSdp });
     // These functions use the legacy interface extensions to RTCPeerConnection.
-    gSecondConnection.setRemoteDescription(parsedOffer,
+    gSecondConnection.setRemoteDescription(parsedOffer).then(
       function() {
-        gSecondConnection.createAnswer(onAnswerCreated,
+        gSecondConnection.createAnswer().then(onAnswerCreated,
                                        failed('createAnswer'));
       },
       failed('setRemoteDescription second'));
@@ -56,7 +56,7 @@ This test uses the legacy callback API with no media, and thus does not require
   function handleAnswer(answerSdp) {
     var parsedAnswer = new RTCSessionDescription({ type: 'answer',
                                                    sdp: answerSdp });
-    gFirstConnection.setRemoteDescription(parsedAnswerignoreSuccess,
+    gFirstConnection.setRemoteDescription(parsedAnswer).then(ignoreSuccess,
                                           failed('setRemoteDescription first'));
   };
 
@@ -125,7 +125,7 @@ This test uses the legacy callback API with no media, and thus does not require
 
     // The offerToReceiveVideo is necessary and sufficient to make
     // an actual connection.
-    gFirstConnection.createOffer(onOfferCreated, failed('createOffer'),
+    gFirstConnection.createOffer().then(onOfferCreated, failed('createOffer'),
         {offerToReceiveVideo: true});
   });
 </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription-expected.txt
deleted file mode 100644 (file)
index 920894f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS Triggers onaddstream when called with a remote description and the MSID is parsed. 
-
index 4d948ee..8651f54 100644 (file)
@@ -44,7 +44,7 @@ property to true in Firefox.
     localStream.getTracks().forEach(function(track) {
       gFirstConnection.addTrack(track, localStream);
     });
-    gFirstConnection.createOffer(onOfferCreated, failed('createOffer'));
+    gFirstConnection.createOffer().then(onOfferCreated, failed('createOffer'));
 
     var videoTag = document.getElementById('local-view');
     videoTag.srcObject = localStream;
@@ -67,7 +67,7 @@ property to true in Firefox.
                                                   sdp: offerSdp });
     gSecondConnection.setRemoteDescription(parsedOffer);
 
-    gSecondConnection.createAnswer(onAnswerCreated,
+    gSecondConnection.createAnswer().then(onAnswerCreated,
                                    failed('createAnswer'));
   };
 
index d36cac1..308ef65 100644 (file)
@@ -613,7 +613,6 @@ webkit.org/b/79203 fast/mediastream/mock-media-source-webaudio.html [ Timeout ]
 webkit.org/b/79203 fast/mediastream/getUserMedia-webaudio.html [ Failure ]
 # Crash is bug #186678
 webkit.org/b/79203 fast/mediastream/MediaStream-video-element-track-stop.html [ Timeout Crash ]
-webkit.org/b/79203 fast/mediastream/RTCPeerConnection-dtmf.html [ Timeout ]
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Failure Crash ]
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass Failure Crash ]
 webkit.org/b/79203 fast/mediastream/MediaStream-video-element.html [ Pass Crash Failure ]
@@ -625,7 +624,6 @@ webkit.org/b/79203 fast/mediastream/RTCPeerConnection-ice.html [ Failure Timeout
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-answer.html [ Failure ]
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure Crash ]
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Failure ]
-webkit.org/b/79203 fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Failure ]
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Pass Crash Failure ]
 webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Failure ]
 webkit.org/b/79203 fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html [ Timeout Failure ]
@@ -639,7 +637,6 @@ webkit.org/b/151344 fast/mediastream/MediaStream-add-ended-tracks.html [ Timeout
 webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disabled.html [ ImageOnlyFailure Crash ]
 webkit.org/b/172269 fast/mediastream/media-devices-enumerate-devices.html [ Failure ]
 webkit.org/b/173257 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ]
-webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ]
 
 # Canvas captureStream support is not implemented
 webkit.org/b/169811 fast/mediacapturefromelement [ Skip ]
index 489d48e..76c4a00 100644 (file)
@@ -19,7 +19,6 @@ imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ]
 # Skip WebRTC for now in WK1
 imported/w3c/web-platform-tests/webrtc [ Skip ]
 webrtc [ Skip ]
-fast/events/constructors/media-stream-event-constructor.html
 
 # Not supported on WK1
 media/no-fullscreen-when-hidden.html [ Skip ]
index 3f13de8..02d7050 100644 (file)
@@ -1061,15 +1061,12 @@ css3/color-filters/color-filter-ignore-semantic.html [ Skip ]
 
 # Run webrtc tests on iOS 11
 imported/w3c/web-platform-tests/webrtc [ Pass ]
-fast/events/constructors/media-stream-event-constructor.html [ Pass ]
 fast/mediastream/RTCIceCandidate.html [ Pass ]
 fast/mediastream/RTCPeerConnection-add-removeTrack.html [ Pass ]
 fast/mediastream/RTCPeerConnection-addIceCandidate.html [ Pass ]
-fast/mediastream/RTCPeerConnection-AddRemoveStream.html [ Pass ]
 fast/mediastream/RTCPeerConnection-addTrack-reuse-sender.html [ Pass ]
 fast/mediastream/RTCPeerConnection-addTransceiver.html [ Pass ]
 fast/mediastream/RTCPeerConnection-createAnswer.html [ Pass ]
-fast/mediastream/RTCPeerConnection-createOffer.html [ Pass ]
 fast/mediastream/RTCPeerConnection-datachannel.html [ Pass ]
 fast/mediastream/RTCPeerConnection-have-local-offer.html [ Pass ]
 fast/mediastream/RTCPeerConnection-have-local-pranswer.html [ Pass ]
@@ -1077,7 +1074,6 @@ fast/mediastream/RTCPeerConnection-have-remote-offer.html [ Pass ]
 fast/mediastream/RTCPeerConnection-have-remote-pranswer.html [ Pass ]
 fast/mediastream/RTCPeerConnection-inspect-answer.html [ Pass ]
 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Pass ]
-fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Pass ]
 fast/mediastream/RTCPeerConnection-localDescription.html [ Pass ]
 fast/mediastream/RTCPeerConnection-media-setup-single-dialog.html [ Pass ]
 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass ]
index bbc0951..b9df4f6 100644 (file)
@@ -138,7 +138,6 @@ fast/mediastream
 imported/w3c/web-platform-tests/mediacapture-streams
 http/tests/media/media-stream
 http/tests/ssl/media-stream
-fast/events/constructors/media-stream-event-constructor.html
 
 # WK1 does not filter response headers.
 http/wpt/loading/redirect-headers.html [ Skip ]
index caf62e6..32b49dd 100644 (file)
@@ -144,7 +144,6 @@ fast/forms/week
 # Media Stream API is not fully supported.
 fast/mediastream/MediaStream-add-ended-tracks.html
 
-fast/mediastream/RTCPeerConnection-dtmf.html [ Skip ]
 fast/mediastream/RTCPeerConnection-ice.html [ Skip ]
 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Skip ]
 fast/mediastream/RTCPeerConnection-stats.html [ Skip ]
index 51d462c..e29a3a8 100644 (file)
@@ -850,7 +850,6 @@ webkit.org/b/38376 media/media-document-audio-size.html [ Skip ]
 # Media Stream API is not yet enabled.
 fast/mediastream [ Skip ]
 imported/w3c/web-platform-tests/mediacapture-streams [ Skip ]
-fast/events/constructors/media-stream-event-constructor.html [ Skip ]
 http/tests/media/media-stream [ Skip ]
 
 # needs enhanced eventSender.contextMenu() return value
index 14eb414..9d48484 100644 (file)
@@ -8,7 +8,7 @@ Found 1 tests
 Details
 
 Result Test Name       Message
-Pass   Testing legacy API is not defined when legacy flag is turned off        
+Pass   Testing legacy API is not defined       
 
-PASS Testing legacy API is not defined when legacy flag is turned off 
+PASS Testing legacy API is not defined 
 
index 0b84495..e521b56 100644 (file)
@@ -5,9 +5,6 @@
     </head>
     <body>
         <script>
-if (window.testRunner)
-    testRunner.setWebRTCLegacyAPIEnabled(false);
-
 promise_test(function() {
     var pc1 = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
     var pc2 = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
@@ -26,7 +23,7 @@ promise_test(function() {
     }).then(() => {
         return pc2.createAnswer({ }, assert_unreached, assert_unreached);
     });
-}, "Testing legacy API is not defined when legacy flag is turned off");
+}, "Testing legacy API is not defined");
         </script>
         <script src="../resources/testharnessreport.js"></script>
     </body>
index a9c4a5f..4d9e61d 100644 (file)
@@ -293,13 +293,11 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/mediastream/MediaDeviceInfo.idl
     Modules/mediastream/MediaDevices.idl
     Modules/mediastream/MediaStream.idl
-    Modules/mediastream/MediaStreamEvent.idl
     Modules/mediastream/MediaStreamTrack.idl
     Modules/mediastream/MediaStreamTrackEvent.idl
     Modules/mediastream/MediaTrackConstraints.idl
     Modules/mediastream/MediaTrackSupportedConstraints.idl
     Modules/mediastream/NavigatorMediaDevices.idl
-    Modules/mediastream/NavigatorUserMedia.idl
     Modules/mediastream/OverconstrainedError.idl
     Modules/mediastream/OverconstrainedErrorEvent.idl
     Modules/mediastream/RTCAnswerOptions.idl
@@ -1830,7 +1828,6 @@ add_dependencies(WebCoreTestSupportBindings WebCore)
 # WebCore JS Builtins
 
 set(WebCore_BUILTINS_SOURCES
-    ${WEBCORE_DIR}/Modules/mediastream/NavigatorUserMedia.js
     ${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnection.js
     ${WEBCORE_DIR}/Modules/mediastream/RTCPeerConnectionInternals.js
     ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
index 5e2fe74..5a24eb1 100644 (file)
@@ -1,3 +1,61 @@
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        This API is no longer needed as the runtime flag is off by default.
+        Removing this option allows removing some code and will ease future WebRTC improvements.
+        Covered by existing tests.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/mediastream/MediaStreamEvent.cpp: Removed.
+        * Modules/mediastream/MediaStreamEvent.h: Removed.
+        * Modules/mediastream/MediaStreamEvent.idl: Removed.
+        * Modules/mediastream/NavigatorUserMedia.idl: Removed.
+        * Modules/mediastream/NavigatorUserMedia.js: Removed.
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl:
+        * Modules/mediastream/RTCPeerConnection.js:
+        (initializeRTCPeerConnection):
+        (createOffer):
+        (createAnswer):
+        (setLocalDescription):
+        (setRemoteDescription):
+        (addIceCandidate):
+        (getLocalStreams): Deleted.
+        (getStreamById): Deleted.
+        (addStream): Deleted.
+        (): Deleted.
+        * Modules/mediastream/RTCPeerConnectionInternals.js:
+        (callbacksAndDictionaryOverload):
+        (if): Deleted.
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
+        (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
+        (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::LibWebRTCPeerConnectionBackend::doStop):
+        (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
+        (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+        (WebCore::isWebRTCLegacyAPIEnabled): Deleted.
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.in:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
+        (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.
+
 2018-08-29  Ryosuke Niwa  <rniwa@webkit.org>
 
         Modernize SlotAssignment
index 6c9b2ce..b77ddbf 100644 (file)
@@ -217,13 +217,11 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/mediastream/MediaDeviceInfo.idl \
     $(WebCore)/Modules/mediastream/MediaDevices.idl \
     $(WebCore)/Modules/mediastream/MediaStream.idl \
-    $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
     $(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
     $(WebCore)/Modules/mediastream/MediaStreamTrackEvent.idl \
     $(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
     $(WebCore)/Modules/mediastream/MediaTrackSupportedConstraints.idl \
     $(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
-    $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
     $(WebCore)/Modules/mediastream/OverconstrainedError.idl \
     $(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
     $(WebCore)/Modules/mediastream/RTCAnswerOptions.idl \
@@ -1515,7 +1513,6 @@ CommandLineAPIModuleSource.h : CommandLineAPIModuleSource.js
 # WebCore JS Builtins
 
 WebCore_BUILTINS_SOURCES = \
-    $(WebCore)/Modules/mediastream/NavigatorUserMedia.js \
     $(WebCore)/Modules/mediastream/RTCPeerConnection.js \
     $(WebCore)/Modules/mediastream/RTCPeerConnectionInternals.js \
     $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp b/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp
deleted file mode 100644 (file)
index 7bd10f6..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MediaStreamEvent.h"
-
-#if ENABLE(WEB_RTC)
-
-#include "MediaStream.h"
-
-namespace WebCore {
-
-Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStream>&& stream)
-{
-    return adoptRef(*new MediaStreamEvent(type, canBubble, cancelable, WTFMove(stream)));
-}
-
-Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
-{
-    return adoptRef(*new MediaStreamEvent(type, initializer, isTrusted));
-}
-
-MediaStreamEvent::MediaStreamEvent(const AtomicString& type, CanBubble canBubble, IsCancelable cancelable, RefPtr<MediaStream>&& stream)
-    : Event(type, canBubble, cancelable)
-    , m_stream(WTFMove(stream))
-{
-}
-
-MediaStreamEvent::MediaStreamEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
-    : Event(type, initializer, isTrusted)
-    , m_stream(initializer.stream)
-{
-}
-
-MediaStreamEvent::~MediaStreamEvent() = default;
-
-MediaStream* MediaStreamEvent::stream() const
-{
-    return m_stream.get();
-}
-
-EventInterface MediaStreamEvent::eventInterface() const
-{
-    return MediaStreamEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
-
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamEvent.h b/Source/WebCore/Modules/mediastream/MediaStreamEvent.h
deleted file mode 100644 (file)
index c7abf5a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEB_RTC)
-
-#include "Event.h"
-#include "MediaStream.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-class MediaStreamEvent : public Event {
-public:
-    virtual ~MediaStreamEvent();
-
-    static Ref<MediaStreamEvent> create(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStream>&&);
-
-    struct Init : EventInit {
-        RefPtr<MediaStream> stream;
-    };
-    static Ref<MediaStreamEvent> create(const AtomicString& type, const Init& initializer, IsTrusted = IsTrusted::No);
-
-    MediaStream* stream() const;
-
-    virtual EventInterface eventInterface() const;
-
-private:
-    MediaStreamEvent(const AtomicString& type, CanBubble, IsCancelable, RefPtr<MediaStream>&&);
-    MediaStreamEvent(const AtomicString& type, const Init&, IsTrusted);
-
-    RefPtr<MediaStream> m_stream;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl b/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl
deleted file mode 100644 (file)
index 5f8c803..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=WEB_RTC,
-    Constructor(DOMString type, optional MediaStreamEventInit eventInitDict),
-    EnabledAtRuntime=WebRTCLegacyAPI&MediaStream,
-] interface MediaStreamEvent : Event {
-    readonly attribute MediaStream? stream;
-};
-
-dictionary MediaStreamEventInit : EventInit {
-    MediaStream? stream = null;
-};
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl b/Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl
deleted file mode 100644 (file)
index 5d86f3c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-* Copyright (C) 2017 Apple Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-* 1. Redistributions of source code must retain the above copyright
-*    notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-*    notice, this list of conditions and the following disclaimer
-*    in the documentation and/or other materials provided with the
-*    distribution.
-* 3. Neither the name of Ericsson nor the names of its contributors
-*    may be used to endorse or promote products derived from this
-*    software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-[
-    Conditional=MEDIA_STREAM&WEB_RTC,
-    EnabledAtRuntime=WebRTCLegacyAPI&MediaDevices,
-] partial interface Navigator {
-    [JSBuiltin] void getUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
-};
diff --git a/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js b/Source/WebCore/Modules/mediastream/NavigatorUserMedia.js
deleted file mode 100644 (file)
index 6ed4f02..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2015 Canon Inc.
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// @conditional=ENABLE(MEDIA_STREAM)
-
-function getUserMedia(options, successCallback, errorCallback)
-{
-    "use strict";
-
-    // FIXME: We should raise a DOM unsupported exception if there is no navigator and properly detect whether method is not called on a Navigator object.
-    if (!(this.mediaDevices && this.mediaDevices.@getUserMedia))
-        throw @makeThisTypeError("Navigator", "getUserMedia");
-
-    if (arguments.length < 3)
-        @throwTypeError("Not enough arguments");
-
-    if (!@isObject(options))
-        @throwTypeError("Argument 1 (options) to Navigator.getUserMedia must be an object");
-
-    if (typeof successCallback !== "function")
-        @throwTypeError("Argument 2 ('successCallback') to Navigator.getUserMedia must be a function");
-    if (typeof errorCallback !== "function")
-        @throwTypeError("Argument 3 ('errorCallback') to Navigator.getUserMedia must be a function");
-
-    this.mediaDevices.@getUserMedia(options).@then(successCallback, errorCallback);
-}
index 7af4665..28734b2 100644 (file)
@@ -37,6 +37,7 @@
 #include "EventNames.h"
 #include "JSRTCSessionDescription.h"
 #include "Logging.h"
+#include "Page.h"
 #include "RTCIceCandidate.h"
 #include "RTCPeerConnection.h"
 #include "RTCPeerConnectionIceEvent.h"
index 3a66011..f8a976b 100644 (file)
@@ -98,8 +98,6 @@ public:
 
     virtual void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) = 0;
 
-    virtual Vector<RefPtr<MediaStream>> getRemoteStreams() const = 0;
-
     virtual Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) = 0;
     virtual void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&) = 0;
     virtual bool notifyAddedTrack(RTCRtpSender&) { return false; }
index f46ac9a..427bf22 100644 (file)
@@ -126,9 +126,6 @@ public:
     // 8.2 Statistics API
     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&);
 
-    // Legacy MediaStream-based API, mostly implemented as JS built-ins
-    Vector<RefPtr<MediaStream>> getRemoteStreams() const { return m_backend->getRemoteStreams(); }
-
     // EventTarget
     EventTargetInterface eventTargetInterface() const final { return RTCPeerConnectionEventTargetInterfaceType; }
     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
index 977338a..1f4359b 100644 (file)
@@ -119,18 +119,17 @@ typedef RTCRtpTransceiverDirection RtpTransceiverDirection;
 
     // 5.1 RTCPeerConnection extensions
     // RTP Media API extensions
-    [PrivateIdentifier, PublicIdentifier] sequence<RTCRtpSender> getSenders();
+    sequence<RTCRtpSender> getSenders();
     sequence<RTCRtpReceiver> getReceivers();
     sequence<RTCRtpTransceiver> getTransceivers();
 
-    [PrivateIdentifier, PublicIdentifier, MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
-    [PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
+    [MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
+    [MayThrowException] void removeTrack(RTCRtpSender sender);
 
     [MayThrowException] RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) track, optional RTCRtpTransceiverInit init);
 
     attribute EventHandler ontrack;
 
-
     // 6.1 Peer-to-peer data API
     // FIXME 169644: missing sctp
 
@@ -145,15 +144,4 @@ typedef RTCRtpTransceiverDirection RtpTransceiverDirection;
 
     // 9.6 Identity Provider API
     // FIXME 169644: missing IdP
-
-    // Legacy MediaStream API
-    [JSBuiltin, EnabledAtRuntime=WebRTCLegacyAPI] sequence<MediaStream> getLocalStreams();
-    [PrivateIdentifier, PublicIdentifier, EnabledAtRuntime=WebRTCLegacyAPI] sequence<MediaStream> getRemoteStreams();
-    [JSBuiltin, EnabledAtRuntime=WebRTCLegacyAPI] MediaStream getStreamById(DOMString streamId);
-
-    [JSBuiltin, EnabledAtRuntime=WebRTCLegacyAPI] void addStream(MediaStream stream);
-    [JSBuiltin, EnabledAtRuntime=WebRTCLegacyAPI] void removeStream(MediaStream stream);
-
-    // Legacy event handler (MediaStream-based API)
-    [EnabledAtRuntime=WebRTCLegacyAPI] attribute EventHandler onaddstream;
 };
index 8302c33..c13ee1e 100644 (file)
@@ -41,85 +41,10 @@ function initializeRTCPeerConnection(configuration)
 
     this.@initializeWith(configuration);
     @putByIdDirectPrivate(this, "operations", []);
-    @putByIdDirectPrivate(this, "localStreams", []);
 
     return this;
 }
 
-function getLocalStreams()
-{
-    "use strict";
-
-    if (!@isRTCPeerConnection(this))
-        throw @makeThisTypeError("RTCPeerConnection", "getLocalStreams");
-
-    return @getByIdDirectPrivate(this, "localStreams").slice();
-}
-
-function getStreamById(streamIdArg)
-{
-    "use strict";
-
-    if (!@isRTCPeerConnection(this))
-        throw @makeThisTypeError("RTCPeerConnection", "getStreamById");
-
-    if (arguments.length < 1)
-        @throwTypeError("Not enough arguments");
-
-    const streamId = @toString(streamIdArg);
-
-    return @getByIdDirectPrivate(this, "localStreams").find(stream => stream.id === streamId)
-        || this.@getRemoteStreams().find(stream => stream.id === streamId)
-        || null;
-}
-
-function addStream(stream)
-{
-    "use strict";
-
-    if (!@isRTCPeerConnection(this))
-        throw @makeThisTypeError("RTCPeerConnection", "addStream");
-
-    if (arguments.length < 1)
-        @throwTypeError("Not enough arguments");
-
-    if (!(stream instanceof @MediaStream))
-        @throwTypeError("Argument 1 ('stream') to RTCPeerConnection.addStream must be an instance of MediaStream");
-
-    if (@getByIdDirectPrivate(this, "localStreams").find(localStream => localStream.id === stream.id))
-        return;
-
-    @getByIdDirectPrivate(this, "localStreams").@push(stream);
-    stream.@getTracks().forEach(track => this.@addTrack(track, stream));
-}
-
-function removeStream(stream)
-{
-    "use strict";
-
-    if (!@isRTCPeerConnection(this))
-        throw @makeThisTypeError("RTCPeerConnection", "removeStream");
-
-    if (arguments.length < 1)
-        @throwTypeError("Not enough arguments");
-
-    if (!(stream instanceof @MediaStream))
-        @throwTypeError("Argument 1 ('stream') to RTCPeerConnection.removeStream must be an instance of MediaStream");
-
-    const indexOfStreamToRemove = @getByIdDirectPrivate(this, "localStreams").findIndex(localStream => localStream.id === stream.id);
-    if (indexOfStreamToRemove === -1)
-        return;
-
-    const senders = this.@getSenders();
-    @getByIdDirectPrivate(this, "localStreams")[indexOfStreamToRemove].@getTracks().forEach(track => {
-        const senderForTrack = senders.find(sender => sender.track && sender.track.id === track.id);
-        if (senderForTrack)
-            this.@removeTrack(senderForTrack);
-    });
-
-    @getByIdDirectPrivate(this, "localStreams").splice(indexOfStreamToRemove, 1);
-}
-
 function createOffer()
 {
     "use strict";
@@ -130,17 +55,9 @@ function createOffer()
     const peerConnection = this;
 
     return @callbacksAndDictionaryOverload(arguments, "createOffer", function (options) {
-        // Promise mode
         return @enqueueOperation(peerConnection, function () {
             return peerConnection.@queuedCreateOffer(options);
         });
-    }, function (successCallback, errorCallback, options) {
-        // Legacy callbacks mode
-        @enqueueOperation(peerConnection, function () {
-            return peerConnection.@queuedCreateOffer(options).@then(successCallback, errorCallback);
-        });
-
-        return @Promise.@resolve(@undefined);
     });
 }
 
@@ -154,17 +71,9 @@ function createAnswer()
     const peerConnection = this;
 
     return @callbacksAndDictionaryOverload(arguments, "createAnswer", function (options) {
-        // Promise mode
         return @enqueueOperation(peerConnection, function () {
             return peerConnection.@queuedCreateAnswer(options);
         });
-    }, function (successCallback, errorCallback, options) {
-        // Legacy callbacks mode
-        @enqueueOperation(peerConnection, function () {
-            return peerConnection.@queuedCreateAnswer(options).@then(successCallback, errorCallback);
-        });
-
-        return @Promise.@resolve(@undefined);
     });
 }
 
@@ -185,17 +94,9 @@ function setLocalDescription()
         "maybeDictionary": "true"
     };
     return @objectAndCallbacksOverload(arguments, "setLocalDescription", objectInfo, function (description) {
-        // Promise mode
         return @enqueueOperation(peerConnection, function () {
             return peerConnection.@queuedSetLocalDescription(description);
         });
-    }, function (description, successCallback, errorCallback) {
-        // Legacy callbacks mode
-        @enqueueOperation(peerConnection, function () {
-            return peerConnection.@queuedSetLocalDescription(description).@then(successCallback, errorCallback);
-        });
-
-        return @Promise.@resolve(@undefined);
     });
 }
 
@@ -216,17 +117,9 @@ function setRemoteDescription()
         "maybeDictionary": "true"
     };
     return @objectAndCallbacksOverload(arguments, "setRemoteDescription", objectInfo, function (description) {
-        // Promise mode
         return @enqueueOperation(peerConnection, function () {
             return peerConnection.@queuedSetRemoteDescription(description);
         });
-    }, function (description, successCallback, errorCallback) {
-        // Legacy callbacks mode
-        @enqueueOperation(peerConnection, function () {
-            return peerConnection.@queuedSetRemoteDescription(description).@then(successCallback, errorCallback);
-        });
-
-        return @Promise.@resolve(@undefined);
     });
 }
 
@@ -250,16 +143,8 @@ function addIceCandidate(candidate)
         "defaultsToNull" : "true"
     };
     return @objectAndCallbacksOverload(arguments, "addIceCandidate", objectInfo, function (candidate) {
-        // Promise mode
         return @enqueueOperation(peerConnection, function () {
             return peerConnection.@queuedAddIceCandidate(candidate);
         });
-    }, function (candidate, successCallback, errorCallback) {
-        // Legacy callbacks mode
-        @enqueueOperation(peerConnection, function () {
-            return peerConnection.@queuedAddIceCandidate(candidate).@then(successCallback, errorCallback);
-        });
-
-        return @Promise.@resolve(@undefined);
     });
 }
index 3bc1d7b..411dcc9 100644 (file)
@@ -54,7 +54,7 @@ function enqueueOperation(peerConnection, operation)
     });
 }
 
-function objectAndCallbacksOverload(args, functionName, objectInfo, promiseMode, legacyMode)
+function objectAndCallbacksOverload(args, functionName, objectInfo, promiseMode)
 {
     "use strict";
 
@@ -80,53 +80,18 @@ function objectAndCallbacksOverload(args, functionName, objectInfo, promiseMode,
     if (!objectArgOk)
         return @Promise.@reject(new @TypeError(`Argument 1 ('${objectInfo.argName}') to RTCPeerConnection.${functionName} must be an instance of ${objectInfo.argType}`));
 
-    if (!@webRTCLegacyAPIEnabled() || argsCount === 1)
-        return promiseMode(objectArg);
-
-    // More than one argument: Legacy mode
-    if (argsCount < 3)
-        return @Promise.@reject(new @TypeError("Not enough arguments"));
-
-    const successCallback = args[1];
-    const errorCallback = args[2];
-
-    if (typeof successCallback !== "function")
-        return @Promise.@reject(new @TypeError(`Argument 2 ('successCallback') to RTCPeerConnection.${functionName} must be a function`));
-
-    if (typeof errorCallback !== "function")
-        return @Promise.@reject(new @TypeError(`Argument 3 ('errorCallback') to RTCPeerConnection.${functionName} must be a function`));
-
-    return legacyMode(objectArg, successCallback, errorCallback);
+    return promiseMode(objectArg);
 }
 
-function callbacksAndDictionaryOverload(args, functionName, promiseMode, legacyMode)
+function callbacksAndDictionaryOverload(args, functionName, promiseMode)
 {
     "use strict";
 
-    if (!@webRTCLegacyAPIEnabled() || args.length <= 1) {
-        // Zero or one arguments: Promise mode
-        const options = args[0];
-        if (args.length && !@isDictionary(options))
-            return @Promise.@reject(new @TypeError(`Argument 1 ('options') to RTCPeerConnection.${functionName} must be a dictionary`));
-
-        return promiseMode(options);
-    }
-
-    // More than one argument: Legacy mode
-    const successCallback = args[0];
-    const errorCallback = args[1];
-    const options = args[2];
-
-    if (typeof successCallback !== "function")
-        return @Promise.@reject(new @TypeError(`Argument 1 ('successCallback') to RTCPeerConnection.${functionName} must be a function`));
-
-    if (typeof errorCallback !== "function")
-        return @Promise.@reject(new @TypeError(`Argument 2 ('errorCallback') to RTCPeerConnection.${functionName} must be a function`));
-
-    if (args.length > 2 && !@isDictionary(options))
-        return @Promise.@reject(new @TypeError(`Argument 3 ('options') to RTCPeerConnection.${functionName} must be a dictionary`));
+    const options = args[0];
+    if (args.length && !@isDictionary(options))
+        return @Promise.@reject(new @TypeError(`Argument 1 ('options') to RTCPeerConnection.${functionName} must be a dictionary`));
 
-    return legacyMode(successCallback, errorCallback, args[2]);
+    return promiseMode(options);
 }
 
 function isRTCPeerConnection(connection)
index a84d66c..bf120d0 100644 (file)
@@ -33,7 +33,6 @@
 #include "LibWebRTCPeerConnectionBackend.h"
 #include "LibWebRTCProvider.h"
 #include "Logging.h"
-#include "MediaStreamEvent.h"
 #include "NotImplemented.h"
 #include "Performance.h"
 #include "PlatformStrategies.h"
@@ -637,22 +636,13 @@ MediaStream& LibWebRTCMediaEndpoint::mediaStreamFromRTCStream(webrtc::MediaStrea
 {
     auto mediaStream = m_streams.ensure(&rtcStream, [&rtcStream, this] {
         auto label = rtcStream.id();
-        auto stream = MediaStream::create(*m_peerConnectionBackend.connection().scriptExecutionContext(), MediaStreamPrivate::create({ }, fromStdString(label)));
-        auto streamPointer = stream.ptr();
-        m_peerConnectionBackend.addRemoteStream(WTFMove(stream));
-        return streamPointer;
+        return MediaStream::create(*m_peerConnectionBackend.connection().scriptExecutionContext(), MediaStreamPrivate::create({ }, fromStdString(label)));
     });
     return *mediaStream.iterator->value;
 }
 
-void LibWebRTCMediaEndpoint::addRemoteStream(webrtc::MediaStreamInterface& rtcStream)
+void LibWebRTCMediaEndpoint::addRemoteStream(webrtc::MediaStreamInterface&)
 {
-    if (!RuntimeEnabledFeatures::sharedFeatures().webRTCLegacyAPIEnabled())
-        return;
-
-    auto& mediaStream = mediaStreamFromRTCStream(rtcStream);
-    m_peerConnectionBackend.connection().fireEvent(MediaStreamEvent::create(eventNames().addstreamEvent,
-        Event::CanBubble::No, Event::IsCancelable::No, &mediaStream));
 }
 
 class RTCRtpReceiverBackend final : public RTCRtpReceiver::Backend {
@@ -711,9 +701,8 @@ void LibWebRTCMediaEndpoint::addRemoteTrack(rtc::scoped_refptr<webrtc::RtpReceiv
 
 void LibWebRTCMediaEndpoint::removeRemoteStream(webrtc::MediaStreamInterface& rtcStream)
 {
-    auto* mediaStream = m_streams.take(&rtcStream);
-    if (mediaStream)
-        m_peerConnectionBackend.removeRemoteStream(mediaStream);
+    bool removed = m_streams.remove(&rtcStream);
+    ASSERT_UNUSED(removed, removed);
 }
 
 void LibWebRTCMediaEndpoint::OnAddStream(rtc::scoped_refptr<webrtc::MediaStreamInterface> stream)
index 4dafaf4..5233168 100644 (file)
@@ -217,7 +217,7 @@ private:
     CreateSessionDescriptionObserver m_createSessionDescriptionObserver;
     SetLocalSessionDescriptionObserver m_setLocalSessionDescriptionObserver;
     SetRemoteSessionDescriptionObserver m_setRemoteSessionDescriptionObserver;
-    HashMap<webrtc::MediaStreamInterface*, MediaStream*> m_streams;
+    HashMap<webrtc::MediaStreamInterface*, RefPtr<MediaStream>> m_streams;
     HashMap<RTCRtpSender*, rtc::scoped_refptr<webrtc::RtpSenderInterface>> m_senders;
 
     bool m_isInitiator { false };
index b811497..22ba150 100644 (file)
@@ -201,7 +201,6 @@ void LibWebRTCPeerConnectionBackend::doStop()
     m_audioSources.clear();
     m_videoSources.clear();
     m_statsPromises.clear();
-    m_remoteStreams.clear();
     m_pendingReceivers.clear();
 }
 
@@ -360,18 +359,6 @@ void LibWebRTCPeerConnectionBackend::notifyRemovedTrack(RTCRtpSender& sender)
     m_endpoint->removeTrack(sender);
 }
 
-void LibWebRTCPeerConnectionBackend::removeRemoteStream(MediaStream* mediaStream)
-{
-    m_remoteStreams.removeFirstMatching([mediaStream](const auto& item) {
-        return item.get() == mediaStream;
-    });
-}
-
-void LibWebRTCPeerConnectionBackend::addRemoteStream(Ref<MediaStream>&& mediaStream)
-{
-    m_remoteStreams.append(WTFMove(mediaStream));
-}
-
 template<typename Source>
 static inline bool updateTrackSource(Source& source, MediaStreamTrack* track)
 {
index 1745b24..fa0f013 100644 (file)
@@ -88,10 +88,6 @@ private:
     void getStatsSucceeded(const DeferredPromise&, Ref<RTCStatsReport>&&);
     void getStatsFailed(const DeferredPromise&, Exception&&);
 
-    Vector<RefPtr<MediaStream>> getRemoteStreams() const final { return m_remoteStreams; }
-    void removeRemoteStream(MediaStream*);
-    void addRemoteStream(Ref<MediaStream>&&);
-
     bool notifyAddedTrack(RTCRtpSender&) final;
     void notifyRemovedTrack(RTCRtpSender&) final;
 
@@ -113,8 +109,6 @@ private:
     bool m_isLocalDescriptionSet { false };
     bool m_isRemoteDescriptionSet { false };
 
-    // FIXME: Make m_remoteStreams a Vector of Ref.
-    Vector<RefPtr<MediaStream>> m_remoteStreams;
     Vector<std::unique_ptr<webrtc::IceCandidateInterface>> m_pendingCandidates;
     Vector<Ref<RealtimeOutgoingAudioSource>> m_audioSources;
     Vector<Ref<RealtimeOutgoingVideoSource>> m_videoSources;
index aa8ccf7..e67ac10 100644 (file)
@@ -159,7 +159,6 @@ Modules/mediastream/MediaDevices.cpp
 Modules/mediastream/MediaDevicesEnumerationRequest.cpp
 Modules/mediastream/MediaDevicesRequest.cpp
 Modules/mediastream/MediaStream.cpp
-Modules/mediastream/MediaStreamEvent.cpp
 Modules/mediastream/MediaStreamRegistry.cpp
 Modules/mediastream/MediaStreamTrack.cpp
 Modules/mediastream/MediaStreamTrackEvent.cpp
@@ -2758,7 +2757,6 @@ JSMediaSource.cpp
 JSMediaStream.cpp
 JSMediaStreamAudioDestinationNode.cpp
 JSMediaStreamAudioSourceNode.cpp
-JSMediaStreamEvent.cpp
 JSMediaStreamTrack.cpp
 JSMediaStreamTrackEvent.cpp
 JSMediaTrackConstraints.cpp
@@ -2785,7 +2783,6 @@ JSNavigatorMediaCapabilities.cpp
 JSNavigatorMediaDevices.cpp
 JSNavigatorOnLine.cpp
 JSNavigatorServiceWorker.cpp
-JSNavigatorUserMedia.cpp
 JSNavigatorWebDriver.cpp
 JSNavigatorWebVR.cpp
 JSNode.cpp
index 8c0323c..b9122d6 100644 (file)
                07277E4D17D018CC0015534D /* JSMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4117D018CC0015534D /* JSMediaStream.h */; };
                07277E4D17D018CC0015534E /* JSCanvasCaptureMediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4117D018CC0015534E /* JSCanvasCaptureMediaStreamTrack.h */; };
                07277E4F17D018CC0015534D /* JSMediaStreamAudioDestinationNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4317D018CC0015534D /* JSMediaStreamAudioDestinationNode.h */; };
-               07277E5117D018CC0015534D /* JSMediaStreamEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4517D018CC0015534D /* JSMediaStreamEvent.h */; };
                07277E5317D018CC0015534D /* JSMediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4717D018CC0015534D /* JSMediaStreamTrack.h */; };
                07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */; };
                072A70401D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */; };
                073B87671E4385AC0071C0EC /* AudioSampleBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87631E43859D0071C0EC /* AudioSampleBufferList.h */; };
                073B87691E4385AC0071C0EC /* AudioSampleDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 073B87651E43859D0071C0EC /* AudioSampleDataSource.h */; };
                073BDC051F68436100EE34ED /* TrackPrivateBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076E11BE1F683E0D00177395 /* TrackPrivateBase.cpp */; };
-               073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */; settings = {ATTRIBUTES = (Private, ); }; };
                074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; };
                0753860314489E9800B78452 /* CachedTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0753860114489E9800B78452 /* CachedTextTrack.h */; };
                07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */; };
                0787C46A1BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */; };
                078E091517D14D1C00420AA1 /* MediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B4D17CEC32700848E51 /* MediaStream.h */; };
-               078E091617D14D1C00420AA1 /* MediaStreamEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5017CEC32700848E51 /* MediaStreamEvent.h */; };
                078E091717D14D1C00420AA1 /* MediaStreamRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5317CEC32700848E51 /* MediaStreamRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E091817D14D1C00420AA1 /* MediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5517CEC32700848E51 /* MediaStreamTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
                078E091917D14D1C00420AA1 /* MediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                07221B4C17CEC32700848E51 /* MediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStream.cpp; sourceTree = "<group>"; };
                07221B4D17CEC32700848E51 /* MediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStream.h; sourceTree = "<group>"; };
                07221B4E17CEC32700848E51 /* MediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStream.idl; sourceTree = "<group>"; };
-               07221B4F17CEC32700848E51 /* MediaStreamEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamEvent.cpp; sourceTree = "<group>"; };
-               07221B5017CEC32700848E51 /* MediaStreamEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamEvent.h; sourceTree = "<group>"; };
-               07221B5117CEC32700848E51 /* MediaStreamEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamEvent.idl; sourceTree = "<group>"; };
                07221B5217CEC32700848E51 /* MediaStreamRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamRegistry.cpp; sourceTree = "<group>"; };
                07221B5317CEC32700848E51 /* MediaStreamRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamRegistry.h; sourceTree = "<group>"; };
                07221B5417CEC32700848E51 /* MediaStreamTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrack.cpp; sourceTree = "<group>"; };
                07221B5717CEC32700848E51 /* MediaStreamTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackEvent.cpp; sourceTree = "<group>"; };
                07221B5817CEC32700848E51 /* MediaStreamTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackEvent.h; sourceTree = "<group>"; };
                07221B5917CEC32700848E51 /* MediaStreamTrackEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamTrackEvent.idl; sourceTree = "<group>"; };
-               07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMedia.idl; sourceTree = "<group>"; };
                07221B6317CEC32700848E51 /* RTCDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDataChannel.cpp; sourceTree = "<group>"; };
                07221B6417CEC32700848E51 /* RTCDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannel.h; sourceTree = "<group>"; };
                07221B6517CEC32700848E51 /* RTCDataChannel.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCDataChannel.idl; sourceTree = "<group>"; };
                07277E4117D018CC0015534E /* JSCanvasCaptureMediaStreamTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasCaptureMediaStreamTrack.h; sourceTree = "<group>"; };
                07277E4217D018CC0015534D /* JSMediaStreamAudioDestinationNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamAudioDestinationNode.cpp; sourceTree = "<group>"; };
                07277E4317D018CC0015534D /* JSMediaStreamAudioDestinationNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamAudioDestinationNode.h; sourceTree = "<group>"; };
-               07277E4417D018CC0015534D /* JSMediaStreamEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamEvent.cpp; sourceTree = "<group>"; };
-               07277E4517D018CC0015534D /* JSMediaStreamEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamEvent.h; sourceTree = "<group>"; };
                07277E4617D018CC0015534D /* JSMediaStreamTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamTrack.cpp; sourceTree = "<group>"; };
                07277E4717D018CC0015534D /* JSMediaStreamTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamTrack.h; sourceTree = "<group>"; };
                07277E4817D018CC0015534D /* JSMediaStreamTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamTrackEvent.cpp; sourceTree = "<group>"; };
                073B87631E43859D0071C0EC /* AudioSampleBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleBufferList.h; sourceTree = "<group>"; };
                073B87641E43859D0071C0EC /* AudioSampleDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioSampleDataSource.mm; sourceTree = "<group>"; };
                073B87651E43859D0071C0EC /* AudioSampleDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSampleDataSource.h; sourceTree = "<group>"; };
-               073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMedia.cpp; sourceTree = "<group>"; };
-               073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMedia.h; sourceTree = "<group>"; };
                0744ECEB1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeAudioSourceMac.h; sourceTree = "<group>"; };
                0744ECEC1E0C4AE5000D0944 /* MockRealtimeAudioSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MockRealtimeAudioSourceMac.mm; sourceTree = "<group>"; };
                074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
                419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; };
                419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
                419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreBuiltinNames.h; sourceTree = "<group>"; };
-               419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = NavigatorUserMedia.js; sourceTree = "<group>"; };
                419FAFAD1ABABCD5005B3572 /* ReadableStreamBYOBReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamBYOBReader.idl; sourceTree = "<group>"; };
                419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; };
                41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
                                07221B4C17CEC32700848E51 /* MediaStream.cpp */,
                                07221B4D17CEC32700848E51 /* MediaStream.h */,
                                07221B4E17CEC32700848E51 /* MediaStream.idl */,
-                               07221B4F17CEC32700848E51 /* MediaStreamEvent.cpp */,
-                               07221B5017CEC32700848E51 /* MediaStreamEvent.h */,
-                               07221B5117CEC32700848E51 /* MediaStreamEvent.idl */,
                                07221B5217CEC32700848E51 /* MediaStreamRegistry.cpp */,
                                07221B5317CEC32700848E51 /* MediaStreamRegistry.h */,
                                07221B5417CEC32700848E51 /* MediaStreamTrack.cpp */,
                                5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */,
                                5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */,
                                5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */,
-                               07221B5C17CEC32700848E51 /* NavigatorUserMedia.idl */,
-                               419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
                                0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */,
                                0704A4031D6DE9F10086DCDB /* OverconstrainedError.idl */,
                                072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */,
                                07277E4117D018CC0015534D /* JSMediaStream.h */,
                                07277E4217D018CC0015534D /* JSMediaStreamAudioDestinationNode.cpp */,
                                07277E4317D018CC0015534D /* JSMediaStreamAudioDestinationNode.h */,
-                               07277E4417D018CC0015534D /* JSMediaStreamEvent.cpp */,
-                               07277E4517D018CC0015534D /* JSMediaStreamEvent.h */,
                                07277E4617D018CC0015534D /* JSMediaStreamTrack.cpp */,
                                07277E4717D018CC0015534D /* JSMediaStreamTrack.h */,
                                07277E4817D018CC0015534D /* JSMediaStreamTrackEvent.cpp */,
                                932CC0D11DFFD667004C0F9F /* JSMediaTrackConstraints.h */,
                                0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */,
                                0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */,
-                               073BE33E17D17E01002BD431 /* JSNavigatorUserMedia.cpp */,
-                               073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
                                0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */,
                                0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */,
                                0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
                                07277E4D17D018CC0015534D /* JSMediaStream.h in Headers */,
                                07277E4F17D018CC0015534D /* JSMediaStreamAudioDestinationNode.h in Headers */,
                                FDBD480D159BC6870093EB4F /* JSMediaStreamAudioSourceNode.h in Headers */,
-                               07277E5117D018CC0015534D /* JSMediaStreamEvent.h in Headers */,
                                07277E5317D018CC0015534D /* JSMediaStreamTrack.h in Headers */,
                                07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */,
                                932CC0D51DFFD667004C0F9F /* JSMediaTrackConstraints.h in Headers */,
                                A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
                                77D510251ED74B5800DA4C87 /* JSNavigatorCredentials.h in Headers */,
                                51F886C01F32923100C193EF /* JSNavigatorServiceWorker.h in Headers */,
-                               073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
                                BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
                                14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
                                1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
                                0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
                                FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */,
                                070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */,
-                               078E091617D14D1C00420AA1 /* MediaStreamEvent.h in Headers */,
                                078E093717D16B2C00420AA1 /* MediaStreamPrivate.h in Headers */,
                                078E091717D14D1C00420AA1 /* MediaStreamRegistry.h in Headers */,
                                078E3CC01FE1C73C00483C1D /* MediaStreamRequest.h in Headers */,
index fa8500e..ebb2f61 100644 (file)
@@ -55,7 +55,6 @@ using namespace JSC;
 
 EncodedJSValue JSC_HOST_CALL makeThisTypeErrorForBuiltins(ExecState*);
 EncodedJSValue JSC_HOST_CALL makeGetterTypeErrorForBuiltins(ExecState*);
-EncodedJSValue JSC_HOST_CALL isWebRTCLegacyAPIEnabled(ExecState*);
 EncodedJSValue JSC_HOST_CALL isReadableByteStreamAPIEnabled(ExecState*);
 
 const ClassInfo JSDOMGlobalObject::s_info = { "DOMGlobalObject", &JSGlobalObject::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMGlobalObject) };
@@ -103,13 +102,6 @@ EncodedJSValue JSC_HOST_CALL makeGetterTypeErrorForBuiltins(ExecState* execState
     return JSValue::encode(createTypeError(execState, makeGetterTypeErrorMessage(interfaceName.utf8().data(), attributeName.utf8().data())));
 }
 
-#if ENABLE(WEB_RTC)
-EncodedJSValue JSC_HOST_CALL isWebRTCLegacyAPIEnabled(ExecState*)
-{
-    return JSValue::encode(jsBoolean(RuntimeEnabledFeatures::sharedFeatures().webRTCLegacyAPIEnabled()));
-}
-#endif
-
 #if ENABLE(STREAMS_API)
 EncodedJSValue JSC_HOST_CALL isReadableByteStreamAPIEnabled(ExecState*)
 {
@@ -170,9 +162,6 @@ void JSDOMGlobalObject::addBuiltinGlobals(VM& vm)
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamBYOBReaderPrivateName(), privateReadableStreamBYOBReaderConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().readableByteStreamAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isReadableByteStreamAPIEnabled), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
 #endif
-#if ENABLE(WEB_RTC)
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().webRTCLegacyAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isWebRTCLegacyAPIEnabled), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-#endif
     };
     addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
 }
index 99eb328..528ca23 100644 (file)
@@ -99,7 +99,6 @@ namespace WebCore {
     macro(MediaKeys) \
     macro(MediaSource) \
     macro(MediaStream) \
-    macro(MediaStreamEvent) \
     macro(MediaStreamTrack) \
     macro(ModernMediaControls) \
     macro(NavigatorCredentials) \
@@ -191,7 +190,6 @@ namespace WebCore {
     macro(WindowClient) \
     macro(WritableStream) \
     macro(XMLHttpRequest) \
-    macro(addTrack) \
     macro(appendFromJS) \
     macro(associatedReadableByteStreamController) \
     macro(autoAllocateChunkSize) \
@@ -223,8 +221,6 @@ namespace WebCore {
     macro(finishConsumingStream) \
     macro(focus) \
     macro(frames) \
-    macro(getRemoteStreams) \
-    macro(getSenders) \
     macro(getTracks) \
     macro(getUserMedia) \
     macro(header) \
@@ -268,7 +264,6 @@ namespace WebCore {
     macro(readableStreamController) \
     macro(reader) \
     macro(readyPromiseCapability) \
-    macro(removeTrack) \
     macro(response) \
     macro(responseCacheIsValid) \
     macro(retrieveResponse) \
@@ -298,7 +293,6 @@ namespace WebCore {
     macro(underlyingSource) \
     macro(view) \
     macro(visualViewport) \
-    macro(webRTCLegacyAPIEnabled) \
     macro(webkit) \
     macro(webkitAudioContext) \
     macro(webkitIDBCursor) \
index 39a1b0e..7157c91 100644 (file)
@@ -48,7 +48,6 @@ ApplePayShippingMethodSelectedEvent conditional=APPLE_PAY
 ApplePayValidateMerchantEvent conditional=APPLE_PAY
 AudioProcessingEvent conditional=WEB_AUDIO
 OfflineAudioCompletionEvent conditional=WEB_AUDIO
-MediaStreamEvent conditional=WEB_RTC
 MediaStreamTrackEvent conditional=MEDIA_STREAM
 MerchantValidationEvent conditional=PAYMENT_REQUEST
 PaymentRequestUpdateEvent conditional=PAYMENT_REQUEST
index 5241296..a60d8a3 100644 (file)
@@ -120,8 +120,6 @@ public:
     void setWebRTCUnifiedPlanEnabled(bool isEnabled) { m_isWebRTCUnifiedPlanEnabled = isEnabled; }
     bool peerConnectionEnabled() const { return m_isPeerConnectionEnabled; }
     void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; }
-    bool webRTCLegacyAPIEnabled() const { return m_webRTCLegacyAPIEnabled; }
-    void setWebRTCLegacyAPIEnabled(bool isEnabled) { m_webRTCLegacyAPIEnabled = isEnabled; }
     bool mdnsICECandidatesEnabled() const { return m_mdnsICECandidatesEnabled; }
     void setMDNSICECandidatesEnabled(bool isEnabled) { m_mdnsICECandidatesEnabled = isEnabled; }
 #endif
@@ -325,7 +323,6 @@ private:
 #if ENABLE(WEB_RTC)
     bool m_isWebRTCUnifiedPlanEnabled { true };
     bool m_isPeerConnectionEnabled { true };
-    bool m_webRTCLegacyAPIEnabled { false };
     bool m_mdnsICECandidatesEnabled { false };
 #endif
 
index 9ddeac1..456e287 100644 (file)
@@ -1,3 +1,22 @@
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetWebRTCLegacyAPIEnabled): Deleted.
+        (WKPreferencesGetWebRTCLegacyAPIEnabled): Deleted.
+        * UIProcess/API/C/WKPreferencesRef.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _webRTCLegacyAPIEnabled]): Deleted.
+        (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): Deleted.
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
 2018-08-29  Chris Dumez  <cdumez@apple.com>
 
         [PSON] We should only process-swap when eTLD+1 changes on navigation
index 1e767d7..1f41929 100644 (file)
@@ -1156,14 +1156,6 @@ IntersectionObserverEnabled:
   category: experimental
   condition: ENABLE(INTERSECTION_OBSERVER)
 
-WebRTCLegacyAPIEnabled:
-  type: bool
-  defaultValue: false
-  humanReadableName: "Enable Legacy WebRTC API"
-  humanReadableDescription: "Enable Legacy WebRTC API"
-  webcoreBinding: RuntimeEnabledFeatures
-  condition: ENABLE(WEB_RTC)
-
 MDNSICECandidatesEnabled:
   type: bool
   defaultValue: false
index cf39550..2b06b4c 100644 (file)
@@ -1428,16 +1428,6 @@ bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->peerConnectionEnabled();
 }
 
-void WKPreferencesSetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef, bool enabled)
-{
-    toImpl(preferencesRef)->setWebRTCLegacyAPIEnabled(enabled);
-}
-
-bool WKPreferencesGetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->webRTCLegacyAPIEnabled();
-}
-
 void WKPreferencesSetWebRTCMDNSICECandidatesEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setMDNSICECandidatesEnabled(enabled);
index 5fd8c93..1c2fbb4 100644 (file)
@@ -268,10 +268,6 @@ WK_EXPORT bool WKPreferencesGetMediaDevicesEnabled(WKPreferencesRef preferencesR
 WK_EXPORT void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef);
 
-// Should default to false
-WK_EXPORT void WKPreferencesSetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef, bool enabled);
-WK_EXPORT bool WKPreferencesGetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef);
-
 // Defaults to false
 WK_EXPORT void WKPreferencesSetWebRTCMDNSICECandidatesEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetWebRTCMDNSICECandidatesEnabled(WKPreferencesRef preferencesRef);
index c49b476..139a89f 100644 (file)
@@ -669,16 +669,6 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setICECandidateFilteringEnabled(enabled);
 }
 
-- (BOOL)_webRTCLegacyAPIEnabled
-{
-    return _preferences->webRTCLegacyAPIEnabled();
-}
-
-- (void)_setWebRTCLegacyAPIEnabled:(BOOL)enabled
-{
-    _preferences->setWebRTCLegacyAPIEnabled(enabled);
-}
-
 - (void)_setJavaScriptCanAccessClipboard:(BOOL)javaScriptCanAccessClipboard
 {
     _preferences->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
index 3879e35..f86fba2 100644 (file)
@@ -118,7 +118,6 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) {
 @property (nonatomic, setter=_setMediaCaptureRequiresSecureConnection:) BOOL _mediaCaptureRequiresSecureConnection WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic, setter=_setEnumeratingAllNetworkInterfacesEnabled:) BOOL _enumeratingAllNetworkInterfacesEnabled WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic, setter=_setICECandidateFilteringEnabled:) BOOL _iceCandidateFilteringEnabled WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
-@property (nonatomic, setter=_setWebRTCLegacyAPIEnabled:) BOOL _webRTCLegacyAPIEnabled WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic, setter=_setInactiveMediaCaptureSteamRepromptIntervalInMinutes:) double _inactiveMediaCaptureSteamRepromptIntervalInMinutes WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
 
 @property (nonatomic, setter=_setJavaScriptCanAccessClipboard:) BOOL _javaScriptCanAccessClipboard WK_API_AVAILABLE(macosx(10.13), ios(11.0));
index fef9005..ff0e185 100644 (file)
@@ -239,8 +239,6 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
 #endif
 
 #if ENABLE(WEB_RTC)
-    if (preference == "WebKitWebRTCLegacyAPIEnabled")
-        RuntimeEnabledFeatures::sharedFeatures().setWebRTCLegacyAPIEnabled(enabled);
     if (preference == "WebKitMDNSICECandidatesEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setMDNSICECandidatesEnabled(enabled);
     if (preference == "WebKitWebRTCUnifiedPlanEnabled")
index d8a4e4c..276c537 100644 (file)
@@ -1,3 +1,19 @@
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences webRTCLegacyAPIEnabled]): Deleted.
+        (-[WebPreferences setWebRTCLegacyAPIEnabled:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
index fc7bf74..d774691 100644 (file)
 #define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
 #define WebKitMediaStreamEnabledPreferenceKey @"WebKitMediaStreamEnabled"
 #define WebKitPeerConnectionEnabledPreferenceKey @"WebKitPeerConnectionEnabled"
-#define WebKitWebRTCLegacyAPIEnabledPreferenceKey @"WebKitWebRTCLegacyAPIEnabled"
 #define WebKitLinkPreloadEnabledPreferenceKey @"WebKitLinkPreloadEnabled"
 #define WebKitMediaPreloadingEnabledPreferenceKey @"WebKitMediaPreloadingEnabled"
 #define WebKitWebAuthenticationEnabledPreferenceKey @"WebKitWebAuthenticationEnabled"
index 3a98607..be6eb0b 100644 (file)
@@ -662,7 +662,6 @@ public:
 #endif
 #if ENABLE(WEB_RTC)
         [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitWebRTCLegacyAPIEnabledPreferenceKey,
 #endif
 #if ENABLE(INTERSECTION_OBSERVER)
         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
@@ -2833,16 +2832,6 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitPeerConnectionEnabledPreferenceKey];
 }
 
-- (BOOL)webRTCLegacyAPIEnabled
-{
-    return [self _boolValueForKey:WebKitWebRTCLegacyAPIEnabledPreferenceKey];
-}
-
-- (void)setWebRTCLegacyAPIEnabled:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitWebRTCLegacyAPIEnabledPreferenceKey];
-}
-
 - (BOOL)linkPreloadEnabled
 {
     return [self _boolValueForKey:WebKitLinkPreloadEnabledPreferenceKey];
index 2f1ddc4..8940118 100644 (file)
@@ -183,9 +183,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (void)setPeerConnectionEnabled:(BOOL)flag;
 - (BOOL)peerConnectionEnabled;
 
-- (void)setWebRTCLegacyAPIEnabled:(BOOL)flag;
-- (BOOL)webRTCLegacyAPIEnabled;
-
 #if !TARGET_OS_IPHONE
 // zero means do AutoScale
 - (float)PDFScaleFactor;
index b892734..0121b08 100644 (file)
@@ -3049,7 +3049,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
 #if ENABLE(WEB_RTC)
     RuntimeEnabledFeatures::sharedFeatures().setPeerConnectionEnabled([preferences peerConnectionEnabled]);
-    RuntimeEnabledFeatures::sharedFeatures().setWebRTCLegacyAPIEnabled([preferences webRTCLegacyAPIEnabled]);
 #endif
 
 #if ENABLE(WEB_AUDIO)
index 31933ba..e38e33a 100644 (file)
@@ -1,3 +1,19 @@
+2018-08-29  Youenn Fablet  <youenn@apple.com>
+
+        Remove WebRTC legacy API implementation
+        https://bugs.webkit.org/show_bug.cgi?id=189040
+
+        Reviewed by Eric Carlson.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setWebRTCLegacyAPIEnabled): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2018-08-29  Daniel Bates  <dabates@apple.com>
 
         lldb-webkit: KeyError thrown for uninitialized OptionSet
index 383a389..15c6878 100644 (file)
@@ -856,7 +856,6 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setWebGL2Enabled:YES];
     [preferences setWebGPUEnabled:YES];
     // FIXME: AsyncFrameScrollingEnabled
-    [preferences setWebRTCLegacyAPIEnabled:YES];
     [preferences setWebAuthenticationEnabled:NO];
     [preferences setCacheAPIEnabled:NO];
     [preferences setReadableByteStreamAPIEnabled:YES];
index 8a080ad..a46c46e 100644 (file)
@@ -320,7 +320,6 @@ interface TestRunner {
     // Open panel
     void setOpenPanelFiles(object filesArray);
 
-    void setWebRTCLegacyAPIEnabled(boolean value);
     void setMDNSICECandidatesEnabled(boolean value);
     void setWebRTCUnifiedPlanEnabled(boolean value);
     void setCustomUserAgent(DOMString userAgent);
index 4595356..d4bcaae 100644 (file)
@@ -455,13 +455,6 @@ void TestRunner::setCustomUserAgent(JSStringRef userAgent)
     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), toWK(userAgent).get(), nullptr);
 }
 
-void TestRunner::setWebRTCLegacyAPIEnabled(bool enabled)
-{
-    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebRTCLegacyAPIEnabled"));
-    auto& injectedBundle = InjectedBundle::singleton();
-    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
-}
-
 void TestRunner::setModernMediaControlsEnabled(bool enabled)
 {
     WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitModernMediaControlsEnabled"));
index 5dea845..bb7a0cf 100644 (file)
@@ -130,7 +130,6 @@ public:
     void setAllowsAnySSLCertificate(bool);
     void setEncryptedMediaAPIEnabled(bool);
     void setMediaDevicesEnabled(bool);
-    void setWebRTCLegacyAPIEnabled(bool);
     void setMDNSICECandidatesEnabled(bool);
     void setWebRTCUnifiedPlanEnabled(bool);
     void setCustomUserAgent(JSStringRef);
index b63da01..41b9505 100644 (file)
@@ -706,7 +706,6 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     WKPreferencesSetXSSAuditorEnabled(preferences, false);
     WKPreferencesSetWebAudioEnabled(preferences, true);
     WKPreferencesSetMediaDevicesEnabled(preferences, true);
-    WKPreferencesSetWebRTCLegacyAPIEnabled(preferences, true);
     WKPreferencesSetWebRTCMDNSICECandidatesEnabled(preferences, false);
     WKPreferencesSetDeveloperExtrasEnabled(preferences, true);
     WKPreferencesSetJavaScriptRuntimeFlags(preferences, kWKJavaScriptRuntimeFlagsAllEnabled);