Bug 1539996 [wpt PR 16092] - Adding WPT for accepting an offer to receive simulcast., a=testonly
authorAmit Hilbuch <amithi@chromium.org>
Thu, 18 Apr 2019 11:57:40 +0000
changeset 529955 881c738e33a8ded55180803b876a1659e3372e5d
parent 529954 43d6bd1f2b750569416b1741a1d75cfac69f4c55
child 529956 2ec3cd4abe31ce851f57bee558140afc75611efe
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1539996, 16092, 1540306, 644886
milestone68.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 1539996 [wpt PR 16092] - Adding WPT for accepting an offer to receive simulcast., a=testonly Automatic update from web-platform-tests Adding WPT for accepting an offer to receive simulcast. This test checks that when a PeerConnection receives an offer from an SFU indicating that the SFU wants to receive simulcast, it generates an answer that negotiates sending simulcast. Bug: None Change-Id: I1b6623169a1c2fd18ee453bfbf8e63cee95e5bd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1540306 Reviewed-by: Harald Alvestrand <hta@chromium.org> Commit-Queue: Amit Hilbuch <amithi@chromium.org> Cr-Commit-Position: refs/heads/master@{#644886} -- wpt-commits: c2bd80a32f478b4029307523d6ee02c2aa695b19 wpt-pr: 16092
testing/web-platform/tests/webrtc/protocol/simulcast-answer.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webrtc/protocol/simulcast-answer.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection Simulcast Answer</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+'use strict';
+
+// Tests for the construction of answers with simulcast according to:
+// draft-ietf-mmusic-sdp-simulcast-13
+// draft-ietf-mmusic-rid-15
+promise_test(async t => {
+  const pc = new RTCPeerConnection();
+  t.add_cleanup(() => pc.close());
+  const expected_rids = ['foo', 'bar', 'baz'];
+
+  const offer_sdp = `v=0
+o=- 3840232462471583827 2 IN IP4 127.0.0.1
+s=-
+t=0 0
+a=group:BUNDLE 0
+a=msid-semantic: WMS
+m=video 9 UDP/TLS/RTP/SAVPF 96
+c=IN IP4 0.0.0.0
+a=rtcp:9 IN IP4 0.0.0.0
+a=ice-ufrag:Li6+
+a=ice-pwd:3C05CTZBRQVmGCAq7hVasHlT
+a=ice-options:trickle
+a=fingerprint:sha-256 5B:D3:8E:66:0E:7D:D3:F3:8E:E6:80:28:19:FC:55:AD:58:5D:B9:3D:A8:DE:45:4A:E7:87:02:F8:3C:0B:3B:B3
+a=setup:actpass
+a=mid:0
+a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
+a=recvonly
+a=rtcp-mux
+a=rtpmap:96 VP8/90000
+a=rtcp-fb:96 goog-remb
+a=rtcp-fb:96 transport-cc
+a=rtcp-fb:96 ccm fir
+a=rid:foo send
+a=rid:bar send
+a=rid:baz send
+a=simulcast:recv foo;bar;baz
+`;
+
+  await pc.setRemoteDescription({type: 'offer', sdp: offer_sdp});
+  const transceiver = pc.getTransceivers()[0];
+  // The created transceiver should be in "recvonly" state. Allow it to send.
+  transceiver.direction = "sendonly";
+  const answer = await pc.createAnswer();
+  let answer_lines = answer.sdp.split('\r\n');
+  // Check for a RID line for each layer.
+  for (const rid of expected_rids) {
+    let result = answer_lines.find(line => line.startsWith(`a=rid:${rid}`));
+    assert_not_equals(result, undefined, `RID attribute for '${rid}' missing.`);
+  }
+
+  // Check for simulcast attribute with send direction and all RIDs.
+  let result = answer_lines.find(
+      line => line.startsWith(`a=simulcast:send ${expected_rids.join(';')}`));
+  assert_not_equals(result, undefined, "Could not find simulcast attribute.");
+}, 'createOffer() with multiple send encodings should create simulcast offer');
+</script>