Changeset 250904 in webkit


Ignore:
Timestamp:
Oct 9, 2019 1:48:10 AM (5 years ago)
Author:
youenn@apple.com
Message:

Remove testRunner.setWebRTCUnifiedPlanEnabled
https://bugs.webkit.org/show_bug.cgi?id=202700

Reviewed by Eric Carlson.

Source/WebKit:

  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:
  • WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

Remove legacy tests and migrate simulcast test to unified plan.

  • fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html:
  • platform/gtk/TestExpectations:
  • webrtc/simulcast-h264.html:
  • webrtc/video-addLegacyTransceiver.html: Removed.
  • webrtc/video-with-receiver.html: Removed.
Location:
trunk
Files:
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r250902 r250904  
     12019-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
    1162019-10-09  Antti Koivisto  <antti@apple.com>
    217
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html

    r235809 r250904  
    1212            description("Test setting up media between two RTCPeerConnection instances with a single SDP dialog.");
    1313
    14             if (window.testRunner) {
    15                 testRunner.setWebRTCUnifiedPlanEnabled(false);
    16                 testRunner.setUserMediaPermission(true);
    17             } else {
     14            if (!window.testRunner) {
    1815                debug("This test can not be run without the testRunner");
    1916                finishJSTest();
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r250874 r250904  
    542542
    543543webkit.org/b/187064 webrtc/audio-peer-connection-g722.html
    544 webkit.org/b/187064 webrtc/video-with-receiver.html
    545544webkit.org/b/187064 webrtc/captureCanvas-webrtc.html
    546545webkit.org/b/187064 webrtc/video-remote-mute.html
     
    35633562webkit.org/b/189345 http/tests/media/clearkey/collect-webkit-media-session.html [ Timeout ]
    35643563
    3565 webkit.org/b/189567 webrtc/video-addLegacyTransceiver.html [ Failure ]
    3566 
    35673564webkit.org/b/189564 http/tests/xmlhttprequest/url-with-credentials.html [ Failure ]
    35683565
  • trunk/LayoutTests/webrtc/simulcast-h264.html

    r236792 r250904  
    1212</div>
    1313<script>
    14 if (window.testRunner)
    15     testRunner.setWebRTCUnifiedPlanEnabled(false);
     14// Code taken from Chrome/Firefox tests and/or simulcast playground.
     15function 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
     86function 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
     135function 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
     166function 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>
     177async 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
    16203var state;
    17204var finished = false;
    18 // This test is largely inspired from Chrome/Firefox/Simulcast playground tests.
     205
     206const pc1 = new RTCPeerConnection();
     207const pc2 = new RTCPeerConnection();
     208
    19209promise_test(async (test) => {
    20210    if (window.testRunner && testRunner.timeout) {
     
    27217    state = "start";
    28218
    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    };
    33246
    34247    let counter = 0;
     
    45258    const localStream = await navigator.mediaDevices.getUserMedia({ video: { width: 640, height: 480 } });
    46259    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);
    109262
    110263    await low.play();
  • trunk/Source/WebKit/ChangeLog

    r250899 r250904  
     12019-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
    1112019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
    212
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

    r250398 r250904  
    236236    if (preference == "WebKitWebRTCMDNSICECandidatesEnabled")
    237237        RuntimeEnabledFeatures::sharedFeatures().setWebRTCMDNSICECandidatesEnabled(enabled);
    238     if (preference == "WebKitWebRTCUnifiedPlanEnabled")
    239         RuntimeEnabledFeatures::sharedFeatures().setWebRTCUnifiedPlanEnabled(enabled);
    240238#endif
    241239
  • trunk/Tools/ChangeLog

    r250899 r250904  
     12019-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
    1122019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r250852 r250904  
    361361
    362362    void setWebRTCMDNSICECandidatesEnabled(boolean value);
    363     void setWebRTCUnifiedPlanEnabled(boolean value);
    364363    void setCustomUserAgent(DOMString userAgent);
    365364
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r250866 r250904  
    432432{
    433433    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"));
    441434    auto& injectedBundle = InjectedBundle::singleton();
    442435    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r250866 r250904  
    132132    void setMediaDevicesEnabled(bool);
    133133    void setWebRTCMDNSICECandidatesEnabled(bool);
    134     void setWebRTCUnifiedPlanEnabled(bool);
    135134    void setCustomUserAgent(JSStringRef);
    136135    void setWebAPIStatisticsEnabled(bool);
Note: See TracChangeset for help on using the changeset viewer.