Bug 1512176 [wpt PR 14378] - Implement RTCRtpReceiver.getParameters(), a=testonly
authorFlorent Castelli <orphis@chromium.org>
Tue, 18 Dec 2018 18:00:04 +0000
changeset 454970 29139abab5c4455841a398f7f2e184b5fb5d16fa
parent 454969 fd849fc7298930f37cc07a51bc57e3040c701af6
child 454971 6d5ffb2fa1803a40a3e95c857fa9b018ee9b8821
push id35420
push userarchaeopteryx@coole-files.de
push dateWed, 23 Jan 2019 16:57:04 +0000
treeherdermozilla-central@4f1ff0e34dd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1512176, 14378, 908911, 1363276, 615518
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1512176 [wpt PR 14378] - Implement RTCRtpReceiver.getParameters(), a=testonly Automatic update from web-platform-tests Implement RTCRtpReceiver.getParameters() Intent: https://groups.google.com/a/chromium.org/d/msg/blink-dev/LXJUzctTVfM/p4J-WrzbBgAJ Bug: 908911 Change-Id: I8e82cc588fb991458e2372fe1dcb9db459cd36b5 Reviewed-on: https://chromium-review.googlesource.com/c/1363276 Reviewed-by: Henrik Boström <hbos@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Commit-Queue: Florent Castelli <orphis@chromium.org> Cr-Commit-Position: refs/heads/master@{#615518} -- wpt-commits: 5dd605cdfae1ab110f1262e7bd52e0083f9784f8 wpt-pr: 14378
testing/web-platform/tests/webrtc/RTCRtpParameters-helper.js
testing/web-platform/tests/webrtc/RTCRtpReceiver-getParameters.html
--- a/testing/web-platform/tests/webrtc/RTCRtpParameters-helper.js
+++ b/testing/web-platform/tests/webrtc/RTCRtpParameters-helper.js
@@ -14,16 +14,18 @@ async function doOfferAnswerExchange(t, 
   const callee = new RTCPeerConnection();
   t.add_cleanup(() => callee.close());
   const offer = await caller.createOffer();
   await caller.setLocalDescription(offer);
   await callee.setRemoteDescription(offer);
   const answer = await callee.createAnswer();
   await callee.setLocalDescription(answer);
   await caller.setRemoteDescription(answer);
+
+  return callee;
 }
 
 /*
   Validates the RTCRtpParameters returned from RTCRtpSender.prototype.getParameters
 
   5.2.  RTCRtpSender Interface
     getParameters
       - transactionId is set to a new unique identifier, used to match this getParameters
--- a/testing/web-platform/tests/webrtc/RTCRtpReceiver-getParameters.html
+++ b/testing/web-platform/tests/webrtc/RTCRtpReceiver-getParameters.html
@@ -28,15 +28,56 @@
         - The codecs sequence is populated based on the codecs that the receiver is currently
           prepared to receive.
 
         - rtcp.reducedSize is set to true if the receiver is currently prepared to receive
           reduced-size RTCP packets, and false otherwise. rtcp.cname is left undefined.
 
         - transactionId and degradationPreference are left undefined.
    */
-  test(t => {
+  promise_test(async t => {
+    const pc = new RTCPeerConnection();
+    t.add_cleanup(() => pc.close());
+    pc.addTransceiver('audio');
+    const callee = await doOfferAnswerExchange(t, pc);
+    const param = callee.getReceivers()[0].getParameters();
+    validateReceiverRtpParameters(param);
+
+    assert_greater_than(param.headerExtensions.length, 0);
+    assert_greater_than(param.codecs.length, 0);
+    assert_equals(param.encodings.length, 1);
+  }, 'getParameters() with audio receiver');
+
+  promise_test(async t => {
     const pc = new RTCPeerConnection();
-    const { receiver } = pc.addTransceiver('audio');
-    const param = receiver.getParameters();
+    t.add_cleanup(() => pc.close());
+    pc.addTransceiver('video');
+    const callee = await doOfferAnswerExchange(t, pc);
+    const param = callee.getReceivers()[0].getParameters();
     validateReceiverRtpParameters(param);
-  });
+
+    assert_greater_than(param.headerExtensions.length, 0);
+    assert_greater_than(param.codecs.length, 0);
+    assert_equals(param.encodings.length, 1);
+  }, 'getParameters() with video receiver');
+
+  promise_test(async t => {
+    const pc = new RTCPeerConnection();
+    t.add_cleanup(() => pc.close());
+    pc.addTransceiver('video', {
+      sendEncodings: [
+        { rid: "rid1" },
+        { rid: "rid2" }
+      ]
+    });
+    const callee = await doOfferAnswerExchange(t, pc);
+    const param = callee.getReceivers()[0].getParameters();
+    validateReceiverRtpParameters(param);
+
+    assert_greater_than(param.headerExtensions.length, 0);
+    assert_greater_than(param.codecs.length, 0);
+    assert_equals(param.encodings.length, 2, 'layer count must match');
+    assert_equals(param.encodings[0].rid, "rid1",
+      'simulcast rids must match');
+    assert_equals(param.encodings[1].rid, "rid2",
+      'simulcast rids must match');
+  }, 'getParameters() with simulcast video receiver');
 </script>