Changeset 250904 in webkit
- Timestamp:
- Oct 9, 2019 1:48:10 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r250902 r250904 1 2019-10-09 youenn fablet <youenn@apple.com> 2 3 Remove testRunner.setWebRTCUnifiedPlanEnabled 4 https://bugs.webkit.org/show_bug.cgi?id=202700 5 6 Reviewed by Eric Carlson. 7 8 Remove legacy tests and migrate simulcast test to unified plan. 9 10 * fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html: 11 * platform/gtk/TestExpectations: 12 * webrtc/simulcast-h264.html: 13 * webrtc/video-addLegacyTransceiver.html: Removed. 14 * webrtc/video-with-receiver.html: Removed. 15 1 16 2019-10-09 Antti Koivisto <antti@apple.com> 2 17 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html
r235809 r250904 12 12 description("Test setting up media between two RTCPeerConnection instances with a single SDP dialog."); 13 13 14 if (window.testRunner) { 15 testRunner.setWebRTCUnifiedPlanEnabled(false); 16 testRunner.setUserMediaPermission(true); 17 } else { 14 if (!window.testRunner) { 18 15 debug("This test can not be run without the testRunner"); 19 16 finishJSTest(); -
trunk/LayoutTests/platform/gtk/TestExpectations
r250874 r250904 542 542 543 543 webkit.org/b/187064 webrtc/audio-peer-connection-g722.html 544 webkit.org/b/187064 webrtc/video-with-receiver.html545 544 webkit.org/b/187064 webrtc/captureCanvas-webrtc.html 546 545 webkit.org/b/187064 webrtc/video-remote-mute.html … … 3563 3562 webkit.org/b/189345 http/tests/media/clearkey/collect-webkit-media-session.html [ Timeout ] 3564 3563 3565 webkit.org/b/189567 webrtc/video-addLegacyTransceiver.html [ Failure ]3566 3567 3564 webkit.org/b/189564 http/tests/xmlhttprequest/url-with-credentials.html [ Failure ] 3568 3565 -
trunk/LayoutTests/webrtc/simulcast-h264.html
r236792 r250904 12 12 </div> 13 13 <script> 14 if (window.testRunner) 15 testRunner.setWebRTCUnifiedPlanEnabled(false); 14 // Code taken from Chrome/Firefox tests and/or simulcast playground. 15 function splitUnifiedPlanOffer(offer) { 16 let sdpLines = offer.sdp.split("\r\n"); 17 18 mSectionStart = sdpLines.findIndex(line => line.startsWith("m=")); 19 mSection = sdpLines.splice(mSectionStart); 20 21 let ssrcs = mSection.filter((line) => { 22 return line.startsWith("a=ssrc"); 23 }); 24 25 let layerRIDS = mSection.filter(line => line.startsWith("a=simulcast:")).map( 26 line => line.replace("a=simulcast:send ", "").split(";") 27 )[0]; 28 29 let midExtmapId = mSection.filter(line => line.includes("urn:ietf:params:rtp-hdrext:sdes:mid")).map(line => 30 line.replace("a=extmap:", "").split(" ")[0] 31 )[0]; 32 33 let ridExtmapId = mSection.filter(line => line.includes("urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id")).map(line => 34 line.replace("a=extmap:", "").split(" ")[0] 35 )[0]; 36 37 mSection = mSection.filter((line) => { 38 return !line.startsWith("a=ssrc") && !line.startsWith("a=simulcast"); 39 }); 40 41 sdpLines = sdpLines.map(line => { 42 if (line.startsWith("a=group:BUNDLE")) 43 return "a=group:BUNDLE " + layerRIDS.join(" "); 44 45 return line; 46 }); 47 48 let counter = 0; 49 for (let layerName of layerRIDS) { 50 sdpLines = sdpLines.concat(mSection.map(line => { 51 if (line.match(/a=msid:/)) { 52 return "a=msid:" + layerName + " " + layerName; 53 } 54 55 if (line.startsWith("a=mid:")) 56 return "a=mid:" + layerName; 57 58 if (line.startsWith("a=extmap:" + midExtmapId + " ")) 59 return "a=extmap:" + midExtmapId + " urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"; 60 61 if (line.startsWith("a=extmap:" + ridExtmapId + " ")) 62 return "a=extmap:" + ridExtmapId + " urn:ietf:params:rtp-hdrext:sdes:mid"; 63 64 if (line.startsWith("a=rid:") || line.startsWith("a=simulcast:")) 65 return null; 66 67 return line; 68 })); 69 sdpLines = sdpLines.concat([ssrcs[counter]]); 70 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4]]); 71 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 1]]); 72 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 2]]); 73 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 3]]); 74 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 4]]); 75 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 5]]); 76 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 6]]); 77 sdpLines = sdpLines.concat([ssrcs[8 * counter + 4 + 7]]); 78 counter = counter + 1; 79 } 80 81 offer.sdp = sdpLines 82 .filter(line => line && line.length > 0) 83 .join("\r\n") + "\r\n"; 84 } 85 86 function splitUnifiedPlanAnswer(answer) { 87 let sdpLines = answer.sdp.split("\r\n"); 88 89 let mSectionStart = sdpLines.findIndex(line => line.startsWith("m=")); 90 let mSection = sdpLines.splice(mSectionStart); 91 92 // Remove extra m= sections 93 mSectionStart = mSection.slice(1).findIndex(line => line.startsWith("m=")); 94 if (mSectionStart != -1) 95 mSection.splice(mSectionStart); 96 97 let midExtmapId = mSection.filter(line => line.includes("urn:ietf:params:rtp-hdrext:sdes:mid")).map(line => 98 line.replace("a=extmap:", "").split(" ")[0] 99 )[0]; 100 101 let ridExtmapId = mSection.filter(line => line.includes("urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id")).map(line => 102 line.replace("a=extmap:", "").split(" ")[0] 103 )[0]; 104 105 sdpLines = sdpLines.map(line => { 106 if (line.startsWith("a=group:BUNDLE")) 107 return "a=group:BUNDLE 0"; 108 109 return line; 110 }); 111 112 mSection = mSection.map(line => { 113 if (line.startsWith("a=mid:")) 114 return "a=mid:0"; 115 116 if (line.startsWith("a=extmap:" + midExtmapId + " ")) 117 return "a=extmap:" + midExtmapId + " urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"; 118 119 if (line.startsWith("a=extmap:" + ridExtmapId + " ")) 120 return "a=extmap:" + ridExtmapId + " urn:ietf:params:rtp-hdrext:sdes:mid"; 121 122 return line; 123 }); 124 125 let params = ["0", "1", "2"]; 126 for(let r in params) { 127 mSection.push("a=rid:" + r + " recv"); 128 } 129 mSection.push("a=simulcast:recv " + params.join(";")); 130 131 answer.sdp = sdpLines.concat(mSection) 132 .filter(line => line && line.length > 0).join("\r\n") + "\r\n"; 133 } 134 135 function enableSimulcastThroughSDP(offer) 136 { 137 match = offer.sdp.match(/a=ssrc:(\d+) cname:(.*)\r\n/); 138 msid = offer.sdp.match(/a=ssrc:(\d+) msid:(.*)\r\n/); 139 var lines = offer.sdp.trim().split('\r\n'); 140 var removed = lines.splice(lines.length - 4, 4); 141 var videoSSRC1 = parseInt(match[1]); 142 rtxSSRC1 = offer.sdp.split('\r\n').filter((line) => { return line.startsWith('a=ssrc-group:FID ')})[0].split(' ')[2]; 143 var videoSSRC2 = videoSSRC1 + 1; 144 var rtxSSRC2 = videoSSRC1 + 2; 145 var videoSSRC3 = videoSSRC1 + 3; 146 var rtxSSRC3 = videoSSRC1 + 4; 147 lines.push(removed[0]); 148 lines.push(removed[1]); 149 lines.push('a=ssrc:' + videoSSRC2 + ' cname:' + match[2]); 150 lines.push('a=ssrc:' + videoSSRC2 + ' msid:' + msid[2]); 151 lines.push('a=ssrc:' + rtxSSRC2 + ' cname:' + match[2]); 152 lines.push('a=ssrc:' + rtxSSRC2 + ' msid:' + msid[2]); 153 154 lines.push('a=ssrc:' + videoSSRC3 + ' cname:' + match[2]); 155 lines.push('a=ssrc:' + videoSSRC3 + ' msid:' + msid[2]); 156 lines.push('a=ssrc:' + rtxSSRC3 + ' cname:' + match[2]); 157 lines.push('a=ssrc:' + rtxSSRC3 + ' msid:' + msid[2]); 158 159 lines.push('a=ssrc-group:FID ' + videoSSRC2 + ' ' + rtxSSRC2); 160 lines.push('a=ssrc-group:FID ' + videoSSRC3 + ' ' + rtxSSRC3); 161 lines.push('a=ssrc-group:SIM ' + videoSSRC1 + ' ' + videoSSRC2 + ' ' + videoSSRC3); 162 163 offer.sdp = lines.join('\r\n') + '\r\n'; 164 } 165 166 function enableSimulcastThroughSDP2(offer) 167 { 168 var lines = offer.sdp.trim().split('\r\n'); 169 170 lines.push('a=simulcast:send 0;1;2'); 171 172 offer.sdp = lines.join('\r\n') + '\r\n'; 173 } 174 175 </script> 176 <script> 177 async function setupCall(pc1, pc2) 178 { 179 let pc1Offer = await pc1.createOffer(); 180 enableSimulcastThroughSDP(pc1Offer); 181 await pc1.setLocalDescription(pc1Offer); 182 183 let pc2Offer = { 184 type: 'offer', 185 sdp: pc1.localDescription.sdp, 186 }; 187 enableSimulcastThroughSDP2(pc2Offer); 188 189 splitUnifiedPlanOffer(pc2Offer); 190 await pc2.setRemoteDescription(pc2Offer); 191 192 let answer = await pc2.createAnswer(); 193 await pc2.setLocalDescription(answer); 194 let pc1Answer = { 195 type: "answer", 196 sdp: pc2.localDescription.sdp, 197 } 198 splitUnifiedPlanAnswer(pc1Answer); 199 200 await pc1.setRemoteDescription(pc1Answer).then(() => {}, (e) => console.log(e)); 201 } 202 16 203 var state; 17 204 var finished = false; 18 // This test is largely inspired from Chrome/Firefox/Simulcast playground tests. 205 206 const pc1 = new RTCPeerConnection(); 207 const pc2 = new RTCPeerConnection(); 208 19 209 promise_test(async (test) => { 20 210 if (window.testRunner && testRunner.timeout) { … … 27 217 state = "start"; 28 218 29 const pc1 = new RTCPeerConnection(); 30 const pc2 = new RTCPeerConnection(); 31 pc1.onicecandidate = (e) => pc2.addIceCandidate(e.candidate); 32 pc2.onicecandidate = (e) => pc1.addIceCandidate(e.candidate); 219 pc1.onicecandidate = e => { 220 if (e.candidate) { 221 for(let layerIndex in ["0", "1", "2"]) { 222 let newCandidate = new RTCIceCandidate({ 223 candidate: e.candidate.candidate, 224 sdpMid: layerIndex, 225 sdpMLineIndex: layerIndex, 226 usernameFragment: e.candidate.usernameFragment, 227 }); 228 setTimeout(() => pc2.addIceCandidate(newCandidate), 5); 229 } 230 } else 231 setTimeout(() => pc1.addIceCandidate(e.candidate), 5); 232 }; 233 234 pc2.onicecandidate = e => { 235 if (e.candidate) { 236 let newCandidate = new RTCIceCandidate({ 237 candidate: e.candidate.candidate, 238 sdpMid: "0", //e.candidate.sdpMid, 239 sdpMLineIndex: e.candidate.sdpMLineIndex, 240 usernameFragment: e.candidate.usernameFragment, 241 }); 242 setTimeout(() => pc1.addIceCandidate(newCandidate), 5); 243 } else 244 setTimeout(() => pc1.addIceCandidate(e.candidate), 5); 245 }; 33 246 34 247 let counter = 0; … … 45 258 const localStream = await navigator.mediaDevices.getUserMedia({ video: { width: 640, height: 480 } }); 46 259 pc1.addTrack(localStream.getVideoTracks()[0], localStream); 47 const offer = await pc1.createOffer(); 48 49 state = "got offer"; 50 51 match = offer.sdp.match(/a=ssrc:(\d+) cname:(.*)\r\n/); 52 msid = offer.sdp.match(/a=ssrc:(\d+) msid:(.*)\r\n/); 53 var lines = offer.sdp.trim().split('\r\n'); 54 var removed = lines.splice(lines.length - 4, 4); 55 var videoSSRC1 = parseInt(match[1]); 56 rtxSSRC1 = offer.sdp.split('\r\n').filter((line) => { return line.startsWith('a=ssrc-group:FID ')})[0].split(' ')[2]; 57 var videoSSRC2 = videoSSRC1 + 1; 58 var rtxSSRC2 = videoSSRC1 + 2; 59 var videoSSRC3 = videoSSRC1 + 3; 60 var rtxSSRC3 = videoSSRC1 + 4; 61 lines.push(removed[0]); 62 lines.push(removed[1]); 63 lines.push('a=ssrc:' + videoSSRC2 + ' cname:' + match[2]); 64 lines.push('a=ssrc:' + videoSSRC2 + ' msid:' + msid[2]); 65 lines.push('a=ssrc:' + rtxSSRC2 + ' cname:' + match[2]); 66 lines.push('a=ssrc:' + rtxSSRC2 + ' msid:' + msid[2]); 67 68 lines.push('a=ssrc:' + videoSSRC3 + ' cname:' + match[2]); 69 lines.push('a=ssrc:' + videoSSRC3 + ' msid:' + msid[2]); 70 lines.push('a=ssrc:' + rtxSSRC3 + ' cname:' + match[2]); 71 lines.push('a=ssrc:' + rtxSSRC3 + ' msid:' + msid[2]); 72 73 lines.push('a=ssrc-group:FID ' + videoSSRC2 + ' ' + rtxSSRC2); 74 lines.push('a=ssrc-group:FID ' + videoSSRC3 + ' ' + rtxSSRC3); 75 lines.push('a=ssrc-group:SIM ' + videoSSRC1 + ' ' + videoSSRC2 + ' ' + videoSSRC3); 76 offer.sdp = lines.join('\r\n') + '\r\n'; 77 78 var offer2 = { 79 type: 'offer', 80 sdp: offer.sdp, 81 }; 82 offer2.sdp = offer2.sdp.replace('a=ssrc-group:SIM ' + videoSSRC1 + ' ' + videoSSRC2 + ' ' + videoSSRC3 + '\r\n', ''); 83 84 offer2.sdp = offer2.sdp.replace('a=ssrc:' + videoSSRC1 + ' msid:' + msid[2], 'a=ssrc:' + videoSSRC1 + ' msid:low low'); 85 offer2.sdp = offer2.sdp.replace('a=ssrc:' + rtxSSRC1 + ' msid:' + msid[2], 'a=ssrc:' + rtxSSRC1 + ' msid:low low'); 86 87 offer2.sdp = offer2.sdp.replace('a=ssrc:' + videoSSRC2 + ' msid:' + msid[2], 'a=ssrc:' + videoSSRC2 + ' msid:mid mid'); 88 offer2.sdp = offer2.sdp.replace('a=ssrc:' + rtxSSRC2 + ' msid:' + msid[2], 'a=ssrc:' + rtxSSRC2 + ' msid:mid mid'); 89 90 offer2.sdp = offer2.sdp.replace('a=ssrc:' + videoSSRC3 + ' msid:' + msid[2], 'a=ssrc:' + videoSSRC3 + ' msid:hi hi'); 91 offer2.sdp = offer2.sdp.replace('a=ssrc:' + rtxSSRC3 + ' msid:' + msid[2], 'a=ssrc:' + rtxSSRC3 + ' msid:hi hi'); 92 await Promise.all([ 93 pc1.setLocalDescription(offer), 94 pc2.setRemoteDescription(offer2), 95 ]); 96 97 state = "set description"; 98 99 const answer = await pc2.createAnswer(); 100 101 state = "got answer"; 102 103 await Promise.all([ 104 pc2.setLocalDescription(answer), 105 pc1.setRemoteDescription(answer), 106 ]); 107 108 state = "set description 2"; 260 261 await setupCall(pc1, pc2); 109 262 110 263 await low.play(); -
trunk/Source/WebKit/ChangeLog
r250899 r250904 1 2019-10-09 youenn fablet <youenn@apple.com> 2 3 Remove testRunner.setWebRTCUnifiedPlanEnabled 4 https://bugs.webkit.org/show_bug.cgi?id=202700 5 6 Reviewed by Eric Carlson. 7 8 * WebProcess/InjectedBundle/InjectedBundle.cpp: 9 (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 10 1 11 2019-10-09 Carlos Garcia Campos <cgarcia@igalia.com> 2 12 -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
r250398 r250904 236 236 if (preference == "WebKitWebRTCMDNSICECandidatesEnabled") 237 237 RuntimeEnabledFeatures::sharedFeatures().setWebRTCMDNSICECandidatesEnabled(enabled); 238 if (preference == "WebKitWebRTCUnifiedPlanEnabled")239 RuntimeEnabledFeatures::sharedFeatures().setWebRTCUnifiedPlanEnabled(enabled);240 238 #endif 241 239 -
trunk/Tools/ChangeLog
r250899 r250904 1 2019-10-09 youenn fablet <youenn@apple.com> 2 3 Remove testRunner.setWebRTCUnifiedPlanEnabled 4 https://bugs.webkit.org/show_bug.cgi?id=202700 5 6 Reviewed by Eric Carlson. 7 8 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 9 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 10 * WebKitTestRunner/InjectedBundle/TestRunner.h: 11 1 12 2019-10-09 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r250852 r250904 361 361 362 362 void setWebRTCMDNSICECandidatesEnabled(boolean value); 363 void setWebRTCUnifiedPlanEnabled(boolean value);364 363 void setCustomUserAgent(DOMString userAgent); 365 364 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r250866 r250904 432 432 { 433 433 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCMDNSICECandidatesEnabled")); 434 auto& injectedBundle = InjectedBundle::singleton();435 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);436 }437 438 void TestRunner::setWebRTCUnifiedPlanEnabled(bool enabled)439 {440 WKRetainPtr<WKStringRef> key = adoptWK(WKStringCreateWithUTF8CString("WebKitWebRTCUnifiedPlanEnabled"));441 434 auto& injectedBundle = InjectedBundle::singleton(); 442 435 WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r250866 r250904 132 132 void setMediaDevicesEnabled(bool); 133 133 void setWebRTCMDNSICECandidatesEnabled(bool); 134 void setWebRTCUnifiedPlanEnabled(bool);135 134 void setCustomUserAgent(JSStringRef); 136 135 void setWebAPIStatisticsEnabled(bool);
Note: See TracChangeset
for help on using the changeset viewer.