Diff
Modified: trunk/LayoutTests/ChangeLog (235479 => 235480)
--- trunk/LayoutTests/ChangeLog 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/ChangeLog 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,3 +1,17 @@
+2018-08-29 Youenn Fablet <[email protected]>
+
+ Add a runtime flag for WebRTC unified plan
+ https://bugs.webkit.org/show_bug.cgi?id=189068
+
+ Reviewed by Eric Carlson.
+
+ * fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt:
+ * webrtc/peer-connection-audio-mute2.html:
+ * webrtc/peer-connection-remote-audio-mute2.html:
+ * webrtc/video-addTrack-expected.txt:
+ * webrtc/video-addTrack.html:
+ * webrtc/video-addTransceiver.html:
+
2018-08-29 Ali Juma <[email protected]>
Generalize suppresion for flaky IntersectionObserver web platform tests
Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt (235479 => 235480)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt 2018-08-29 21:50:28 UTC (rev 235480)
@@ -33,10 +33,10 @@
PASS transceiver.stopped is false
Try to add same track again
PASS sender = pc.addTrack(track, stream) threw exception InvalidAccessError: The object does not support the operation or argument..
-FAIL sender2 = pc.addTrack(track2, stream, stream2) should not throw exception. Threw exception InvalidAccessError: Unable to add track.
+PASS sender2 = pc.addTrack(track2, stream, stream2) did not throw exception.
PASS pc.getSenders().length is 2
PASS pc.getSenders()[0] is sender
-FAIL pc.getSenders()[1] should be undefined (of type undefined). Was [object RTCRtpSender] (of type object).
+PASS pc.getSenders()[1] is sender2
PASS pc.removeTrack(sender) did not throw exception.
Sender is still in getSenders() list
PASS pc.getSenders().length is 2
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235479 => 235480)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,3 +1,12 @@
+2018-08-29 Youenn Fablet <[email protected]>
+
+ Add a runtime flag for WebRTC unified plan
+ https://bugs.webkit.org/show_bug.cgi?id=189068
+
+ Reviewed by Eric Carlson.
+
+ * web-platform-tests/webrtc/RTCPeerConnection-addTrack.https-expected.txt:
+
2018-08-29 Ali Juma <[email protected]>
[IntersectionObserver] Implement intersection logic for the same-document implicit root case
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https-expected.txt (235479 => 235480)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https-expected.txt 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addTrack.https-expected.txt 2018-08-29 21:50:28 UTC (rev 235480)
@@ -2,7 +2,7 @@
PASS addTrack when pc is closed should throw InvalidStateError
PASS addTrack with single track argument and no mediaStream should succeed
PASS addTrack with single track argument and single mediaStream should succeed
-FAIL addTrack with single track argument and multiple mediaStreams should succeed promise_test: Unhandled rejection with value: object "InvalidAccessError: Unable to add track"
+PASS addTrack with single track argument and multiple mediaStreams should succeed
PASS Adding the same track multiple times should throw InvalidAccessError
PASS addTrack with existing sender with null track, same kind, and recvonly direction should reuse sender
PASS addTrack with existing sender with null track, same kind, and sendrecv direction should create new sender
Modified: trunk/LayoutTests/webrtc/peer-connection-audio-mute2.html (235479 => 235480)
--- trunk/LayoutTests/webrtc/peer-connection-audio-mute2.html 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/webrtc/peer-connection-audio-mute2.html 2018-08-29 21:50:28 UTC (rev 235480)
@@ -17,7 +17,7 @@
var remoteStream;
return new Promise((resolve, reject) => {
createConnections((firstConnection) => {
- firstConnection.addTrack(localTrack);
+ firstConnection.addTrack(localTrack, localStream);
}, (secondConnection) => {
secondConnection._ontrack_ = (trackEvent) => {
remoteStream = trackEvent.streams[0];
Modified: trunk/LayoutTests/webrtc/peer-connection-remote-audio-mute2.html (235479 => 235480)
--- trunk/LayoutTests/webrtc/peer-connection-remote-audio-mute2.html 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/webrtc/peer-connection-remote-audio-mute2.html 2018-08-29 21:50:28 UTC (rev 235480)
@@ -16,7 +16,7 @@
var remoteStream;
return new Promise((resolve, reject) => {
createConnections((firstConnection) => {
- firstConnection.addTrack(localStream.getAudioTracks()[0]);
+ firstConnection.addTrack(localStream.getAudioTracks()[0], localStream);
}, (secondConnection) => {
secondConnection._ontrack_ = (trackEvent) => {
remoteStream = trackEvent.streams[0];
Modified: trunk/LayoutTests/webrtc/video-addTrack-expected.txt (235479 => 235480)
--- trunk/LayoutTests/webrtc/video-addTrack-expected.txt 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/webrtc/video-addTrack-expected.txt 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,5 +1,5 @@
-
+
PASS Basic video exchange with addTrack - waiting for second track before playing
PASS Basic video exchange with addTrack - not waiting for second track to play
PASS track 0, wait = true
@@ -7,5 +7,5 @@
PASS Testing image result, wait = true
PASS track 0, wait = false
PASS track 1, wait = false
-FAIL Testing image result, wait = false The index is not in the allowed range.
+PASS Testing image result, wait = false
Modified: trunk/LayoutTests/webrtc/video-addTrack.html (235479 => 235480)
--- trunk/LayoutTests/webrtc/video-addTrack.html 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/webrtc/video-addTrack.html 2018-08-29 21:50:28 UTC (rev 235480)
@@ -51,7 +51,7 @@
return new Promise((resolve, reject) => {
createConnections((firstConnection) => {
assert_equals(stream.getTracks().length, 2);
- stream.getTracks().forEach(track => firstConnection.addTrack(track));
+ stream.getTracks().forEach(track => firstConnection.addTrack(track, stream));
}, (secondConnection) => {
var count = 0;
secondConnection._ontrack_ = (trackEvent) => {
Modified: trunk/LayoutTests/webrtc/video-addTransceiver.html (235479 => 235480)
--- trunk/LayoutTests/webrtc/video-addTransceiver.html 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/LayoutTests/webrtc/video-addTransceiver.html 2018-08-29 21:50:28 UTC (rev 235480)
@@ -11,6 +11,8 @@
<canvas id="canvas" width="640" height="480"></canvas>
<script src =""
<script>
+if (window.testRunner)
+ testRunner.setWebRTCUnifiedPlanEnabled(false);
promise_test((test) => {
var pc = new RTCPeerConnection();
Modified: trunk/Source/WebCore/ChangeLog (235479 => 235480)
--- trunk/Source/WebCore/ChangeLog 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebCore/ChangeLog 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,3 +1,25 @@
+2018-08-29 Youenn Fablet <[email protected]>
+
+ Add a runtime flag for WebRTC unified plan
+ https://bugs.webkit.org/show_bug.cgi?id=189068
+
+ Reviewed by Eric Carlson.
+
+ Covered by existing updated tests.
+ Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream.
+ Receive-only case in unified plan is not yet supported.
+ This will be supported in follow-up patches.
+
+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+ (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag.
+ (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan.
+ (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const):
+ (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const):
+ (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case.
+ * page/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const):
+ (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled):
+
2018-08-28 Simon Fraser <[email protected]>
Fix crash when reflections and backdrop filter are combined
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (235479 => 235480)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp 2018-08-29 21:50:28 UTC (rev 235480)
@@ -80,6 +80,9 @@
bool LibWebRTCMediaEndpoint::setConfiguration(LibWebRTCProvider& client, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
{
+ if (RuntimeEnabledFeatures::sharedFeatures().webRTCUnifiedPlanEnabled())
+ configuration.sdp_semantics = webrtc::SdpSemantics::kUnifiedPlan;
+
if (!m_backend) {
m_backend = client.createPeerConnection(*this, WTFMove(configuration));
return !!m_backend;
@@ -197,12 +200,13 @@
{
ASSERT(m_backend);
- String mediaStreamId = mediaStreamIds.isEmpty() ? createCanonicalUUIDString() : mediaStreamIds[0];
- rtc::scoped_refptr<webrtc::MediaStreamInterface> mediaStream = m_localStreams.get(mediaStreamId);
- if (!mediaStream) {
- mediaStream = m_peerConnectionFactory.CreateLocalMediaStream(mediaStreamId.utf8().data());
- m_backend->AddStream(mediaStream);
- m_localStreams.add(mediaStreamId, mediaStream);
+ if (!RuntimeEnabledFeatures::sharedFeatures().webRTCUnifiedPlanEnabled()) {
+ String mediaStreamId = mediaStreamIds.isEmpty() ? createCanonicalUUIDString() : mediaStreamIds[0];
+ m_localStreams.ensure(mediaStreamId, [&] {
+ auto mediaStream = m_peerConnectionFactory.CreateLocalMediaStream(mediaStreamId.utf8().data());
+ m_backend->AddStream(mediaStream);
+ return mediaStream;
+ });
}
std::vector<std::string> ids;
@@ -246,6 +250,7 @@
bool LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio() const
{
+ ASSERT(!RuntimeEnabledFeatures::sharedFeatures().webRTCUnifiedPlanEnabled());
for (const auto& transceiver : m_peerConnectionBackend.connection().getTransceivers()) {
if (transceiver->sender().trackKind() != "audio")
continue;
@@ -261,6 +266,7 @@
bool LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo() const
{
+ ASSERT(!RuntimeEnabledFeatures::sharedFeatures().webRTCUnifiedPlanEnabled());
for (const auto& transceiver : m_peerConnectionBackend.connection().getTransceivers()) {
if (transceiver->sender().trackKind() != "video")
continue;
@@ -282,11 +288,13 @@
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions rtcOptions;
rtcOptions.ice_restart = options.iceRestart;
rtcOptions.voice_activity_detection = options.voiceActivityDetection;
- // FIXME: offer_to_receive_audio and offer_to_receive_video are used as libwebrtc does not support transceivers yet.
- if (shouldOfferAllowToReceiveAudio())
- rtcOptions.offer_to_receive_audio = webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
- if (shouldOfferAllowToReceiveVideo())
- rtcOptions.offer_to_receive_video = webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
+
+ if (!RuntimeEnabledFeatures::sharedFeatures().webRTCUnifiedPlanEnabled()) {
+ if (shouldOfferAllowToReceiveAudio())
+ rtcOptions.offer_to_receive_audio = webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
+ if (shouldOfferAllowToReceiveVideo())
+ rtcOptions.offer_to_receive_video = webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
+ }
m_backend->CreateOffer(&m_createSessionDescriptionObserver, rtcOptions);
}
Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (235479 => 235480)
--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2018-08-29 21:50:28 UTC (rev 235480)
@@ -116,6 +116,8 @@
#endif
#if ENABLE(WEB_RTC)
+ bool webRTCUnifiedPlanEnabled() const { return m_isWebRTCUnifiedPlanEnabled; }
+ 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; }
@@ -321,6 +323,7 @@
#endif
#if ENABLE(WEB_RTC)
+ bool m_isWebRTCUnifiedPlanEnabled { true };
bool m_isPeerConnectionEnabled { true };
bool m_webRTCLegacyAPIEnabled { false };
bool m_mdnsICECandidatesEnabled { false };
Modified: trunk/Source/WebKit/ChangeLog (235479 => 235480)
--- trunk/Source/WebKit/ChangeLog 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebKit/ChangeLog 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,3 +1,14 @@
+2018-08-29 Youenn Fablet <[email protected]>
+
+ Add a runtime flag for WebRTC unified plan
+ https://bugs.webkit.org/show_bug.cgi?id=189068
+
+ Reviewed by Eric Carlson.
+
+ * Shared/WebPreferences.yaml:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
2018-08-29 Aditya Keerthi <[email protected]>
Followup (r235427): Use the null string instead of std::nullopt when no suggestion is selected
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (235479 => 235480)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2018-08-29 21:50:28 UTC (rev 235480)
@@ -494,6 +494,15 @@
webcoreBinding: RuntimeEnabledFeatures
condition: ENABLE(WEB_RTC)
+WebRTCUnifiedPlanEnabled:
+ type: bool
+ defaultValue: true
+ webcoreBinding: RuntimeEnabledFeatures
+ condition: ENABLE(WEB_RTC)
+ humanReadableName: "WebRTC Unified Plan"
+ humanReadableDescription: "Use WebRTC Unified Plan"
+ category: experimental
+
UseLegacyTextAlignPositionedElementBehavior:
type: bool
defaultValue: false
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (235479 => 235480)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2018-08-29 21:50:28 UTC (rev 235480)
@@ -243,6 +243,8 @@
RuntimeEnabledFeatures::sharedFeatures().setWebRTCLegacyAPIEnabled(enabled);
if (preference == "WebKitMDNSICECandidatesEnabled")
RuntimeEnabledFeatures::sharedFeatures().setMDNSICECandidatesEnabled(enabled);
+ if (preference == "WebKitWebRTCUnifiedPlanEnabled")
+ RuntimeEnabledFeatures::sharedFeatures().setWebRTCUnifiedPlanEnabled(enabled);
#endif
if (preference == "WebKitIsSecureContextAttributeEnabled") {
Modified: trunk/Tools/ChangeLog (235479 => 235480)
--- trunk/Tools/ChangeLog 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Tools/ChangeLog 2018-08-29 21:50:28 UTC (rev 235480)
@@ -1,3 +1,15 @@
+2018-08-29 Youenn Fablet <[email protected]>
+
+ Add a runtime flag for WebRTC unified plan
+ https://bugs.webkit.org/show_bug.cgi?id=189068
+
+ Reviewed by Eric Carlson.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setWebRTCUnifiedPlanEnabled):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
2018-08-29 Don Olmstead <[email protected]>
[CMake] Split Tools/CMakeLists.txt into platform files
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (235479 => 235480)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2018-08-29 21:50:28 UTC (rev 235480)
@@ -322,6 +322,7 @@
void setWebRTCLegacyAPIEnabled(boolean value);
void setMDNSICECandidatesEnabled(boolean value);
+ void setWebRTCUnifiedPlanEnabled(boolean value);
void setCustomUserAgent(DOMString userAgent);
void terminateNetworkProcess();
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (235479 => 235480)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2018-08-29 21:50:28 UTC (rev 235480)
@@ -442,6 +442,13 @@
WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
}
+void TestRunner::setWebRTCUnifiedPlanEnabled(bool enabled)
+{
+ WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled"));
+ auto& injectedBundle = InjectedBundle::singleton();
+ WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
void TestRunner::setCustomUserAgent(JSStringRef userAgent)
{
WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCustomUserAgent"));
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (235479 => 235480)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2018-08-29 21:20:16 UTC (rev 235479)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2018-08-29 21:50:28 UTC (rev 235480)
@@ -132,6 +132,7 @@
void setMediaDevicesEnabled(bool);
void setWebRTCLegacyAPIEnabled(bool);
void setMDNSICECandidatesEnabled(bool);
+ void setWebRTCUnifiedPlanEnabled(bool);
void setCustomUserAgent(JSStringRef);
// Special DOM functions.