Bug 1637979 [wpt PR 23601] - Move all priority-related wpt/webrtc tests to webrtc-priority, a=testonly
authorHarald Alvestrand <hta@chromium.org>
Thu, 21 May 2020 10:18:44 +0000
changeset 531982 287f42f089dcc81830e039939439d968354eae54
parent 531981 5f0ca3252ece652dadc31a7caad6bafb920a27f3
child 531983 29df6ed3816b37b13afeda9976de8ce0892c0df9
push id37449
push userncsoregi@mozilla.com
push dateTue, 26 May 2020 02:38:57 +0000
treeherdermozilla-central@da2c7b0ac9a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1637979, 23601, 2201757, 768834
milestone78.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 1637979 [wpt PR 23601] - Move all priority-related wpt/webrtc tests to webrtc-priority, a=testonly Automatic update from web-platform-tests Move all priority-related wpt/webrtc tests to webrtc-priority This aligns tests with a new document split. Bug: https://github.com/w3c/webrtc-priority/issues/8 Change-Id: Idb512da6c34c866552f1155dd0ee4df6754dee6f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2201757 Reviewed-by: Philip J├Ągenstedt <foolip@chromium.org> Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/master@{#768834} -- wpt-commits: da71b38ca8639d270e59b07fe65b0fecd6944a4a wpt-pr: 23601
testing/web-platform/tests/webrtc-priority/RTCPeerConnection-ondatachannel.html
testing/web-platform/tests/webrtc-priority/RTCRtpParameters-encodings.html
testing/web-platform/tests/webrtc/RTCPeerConnection-addTransceiver.https.html
testing/web-platform/tests/webrtc/RTCPeerConnection-ondatachannel.html
testing/web-platform/tests/webrtc/RTCRtpParameters-encodings.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webrtc-priority/RTCPeerConnection-ondatachannel.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection.prototype.ondatachannel</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../webrtc/RTCPeerConnection-helper.js"></script>
+<script>
+'use strict';
+
+promise_test(async (t) => {
+  const resolver = new Resolver();
+  const pc1 = new RTCPeerConnection();
+  const pc2 = new RTCPeerConnection();
+  t.add_cleanup(() => pc1.close());
+  t.add_cleanup(() => pc2.close());
+
+  const dc1 = pc1.createDataChannel('test', {
+    ordered: false,
+    maxRetransmits: 1,
+    protocol: 'custom',
+    priority: 'high'
+  });
+
+  assert_equals(dc1.priority, 'high');
+
+  pc2.ondatachannel = t.step_func((event) => {
+    const dc2 = event.channel;
+
+    assert_equals(dc2.priority, 'high');
+
+    resolver.resolve();
+  });
+
+  exchangeIceCandidates(pc1, pc2);
+  await doSignalingHandshake(pc1, pc2);
+
+  await resolver;
+}, 'In-band negotiated channel created on remote peer should match the same configuration as local ' +
+  'peer');
+
+promise_test(async (t) => {
+  const resolver = new Resolver();
+  const pc1 = new RTCPeerConnection();
+  const pc2 = new RTCPeerConnection();
+  t.add_cleanup(() => pc1.close());
+  t.add_cleanup(() => pc2.close());
+
+  const dc1 = pc1.createDataChannel('');
+
+  assert_equals(dc1.priority, 'low');
+
+  pc2.ondatachannel = t.step_func((event) => {
+    const dc2 = event.channel;
+    assert_equals(dc2.priority, 'low');
+
+    resolver.resolve();
+  });
+
+  exchangeIceCandidates(pc1, pc2);
+  await doSignalingHandshake(pc1, pc2);
+
+  await resolver;
+}, 'In-band negotiated channel created on remote peer should match the same (default) ' +
+  'configuration as local peer');
+
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webrtc-priority/RTCRtpParameters-encodings.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCRtpParameters encodings</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../webrtc/dictionary-helper.js"></script>
+<script src="../webrtc/RTCRtpParameters-helper.js"></script>
+<script>
+  'use strict';
+
+  promise_test(async t => {
+    const pc = new RTCPeerConnection();
+    t.add_cleanup(() => pc.close());
+    const { sender } = pc.addTransceiver('video', {
+      sendEncodings: [{
+        active: false,
+        priority: 'low',
+        networkPriority: 'low',
+        maxBitrate: 8,
+        maxFramerate: 25,
+        rid: 'foo'
+      }]
+    });
+    await doOfferAnswerExchange(t, pc);
+
+    const param = sender.getParameters();
+    validateSenderRtpParameters(param);
+    const encoding = getFirstEncoding(param);
+
+    assert_equals(encoding.active, false);
+    assert_equals(encoding.priority, 'low');
+    assert_equals(encoding.networkPriority, 'low');
+  }, `sender.getParameters() should return sendEncodings set by addTransceiver()`);
+
+  test_modified_encoding('audio', 'active', false, true,
+    'setParameters() with modified encoding.active should succeed');
+
+  test_modified_encoding('audio', 'priority', 'very-low', 'high',
+    'setParameters() with modified encoding.priority should succeed');
+
+  test_modified_encoding('audio', 'networkPriority', 'very-low', 'high',
+    'setParameters() with modified encoding.networkPriority should succeed');
+
+</script>
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-addTransceiver.https.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-addTransceiver.https.html
@@ -358,17 +358,16 @@
   test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     pc.addTransceiver('audio', {
       sendEncodings: [{
         dtx: 'enabled',
         active: false,
-        priority: 'low',
         ptime: 5,
         maxBitrate: 8,
         maxFramerate: 25,
         rid: 'foo'
       }]
     });
   }, `addTransceiver() with valid sendEncodings should succeed`);
 
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-ondatachannel.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-ondatachannel.html
@@ -219,34 +219,31 @@ promise_test(async (t) => {
     interface RTCDataChannel : EventTarget {
       readonly attribute USVString           label;
       readonly attribute boolean             ordered;
       readonly attribute unsigned short?     maxPacketLifeTime;
       readonly attribute unsigned short?     maxRetransmits;
       readonly attribute USVString           protocol;
       readonly attribute boolean             negotiated;
       readonly attribute unsigned short?     id;
-      readonly attribute RTCPriorityType     priority;
       readonly attribute RTCDataChannelState readyState;
       ...
     };
 
     When an underlying data transport is to be announced (the other peer created a channel with
     negotiated unset or set to false), the user agent of the peer that did not initiate the
     creation process MUST queue a task to run the following steps:
       2. Let channel be a newly created RTCDataChannel object.
       3. Let configuration be an information bundle received from the other peer as a part of the
          process to establish the underlying data transport described by the WebRTC DataChannel
          Protocol specification [RTCWEB-DATA-PROTOCOL].
       4. Initialize channel's [[DataChannelLabel]], [[Ordered]], [[MaxPacketLifeTime]],
          [[MaxRetransmits]], [[DataChannelProtocol]], and [[DataChannelId]] internal slots to the
          corresponding values in configuration.
       5. Initialize channel's [[Negotiated]] internal slot to false.
-      6. Initialize channel's [[DataChannelPriority]] internal slot based on the integer priority
-         value in configuration, [...]
       7. Set channel's [[ReadyState]] slot to connecting.
       8. Fire a datachannel event named datachannel with channel at the RTCPeerConnection object.
 
     Note: More exhaustive tests are defined in RTCDataChannel-dcep
  */
 
 promise_test(async (t) => {
   const resolver = new Resolver();
@@ -254,40 +251,37 @@ promise_test(async (t) => {
   const pc2 = new RTCPeerConnection();
   t.add_cleanup(() => pc1.close());
   t.add_cleanup(() => pc2.close());
 
   const dc1 = pc1.createDataChannel('test', {
     ordered: false,
     maxRetransmits: 1,
     protocol: 'custom',
-    priority: 'high'
   });
 
   assert_equals(dc1.label, 'test');
   assert_equals(dc1.ordered, false);
   assert_equals(dc1.maxPacketLifeTime, null);
   assert_equals(dc1.maxRetransmits, 1);
   assert_equals(dc1.protocol, 'custom');
   assert_equals(dc1.negotiated, false);
-  assert_equals(dc1.priority, 'high');
 
   pc2.ondatachannel = t.step_func((event) => {
     const dc2 = event.channel;
     assert_true(dc2 instanceof RTCDataChannel,
       'Expect channel to be instance of RTCDataChannel');
 
     assert_equals(dc2.label, 'test');
     assert_equals(dc2.ordered, false);
     assert_equals(dc2.maxPacketLifeTime, null);
     assert_equals(dc2.maxRetransmits, 1);
     assert_equals(dc2.protocol, 'custom');
     assert_equals(dc2.negotiated, false);
     assert_equals(dc2.id, dc1.id);
-    assert_equals(dc2.priority, 'high');
 
     resolver.resolve();
   });
 
   exchangeIceCandidates(pc1, pc2);
   await exchangeOfferAnswer(pc1, pc2);
 
   await resolver;
@@ -304,31 +298,29 @@ promise_test(async (t) => {
   const dc1 = pc1.createDataChannel('');
 
   assert_equals(dc1.label, '');
   assert_equals(dc1.ordered, true);
   assert_equals(dc1.maxPacketLifeTime, null);
   assert_equals(dc1.maxRetransmits, null);
   assert_equals(dc1.protocol, '');
   assert_equals(dc1.negotiated, false);
-  assert_equals(dc1.priority, 'low');
 
   pc2.ondatachannel = t.step_func((event) => {
     const dc2 = event.channel;
     assert_true(dc2 instanceof RTCDataChannel,
       'Expect channel to be instance of RTCDataChannel');
 
     assert_equals(dc2.label, '');
     assert_equals(dc2.ordered, true);
     assert_equals(dc2.maxPacketLifeTime, null);
     assert_equals(dc2.maxRetransmits, null);
     assert_equals(dc2.protocol, '');
     assert_equals(dc2.negotiated, false);
     assert_equals(dc2.id, dc1.id);
-    assert_equals(dc2.priority, 'low');
 
     resolver.resolve();
   });
 
   exchangeIceCandidates(pc1, pc2);
   await exchangeOfferAnswer(pc1, pc2);
 
   await resolver;
--- a/testing/web-platform/tests/webrtc/RTCRtpParameters-encodings.html
+++ b/testing/web-platform/tests/webrtc/RTCRtpParameters-encodings.html
@@ -40,33 +40,24 @@
         sequence<RTCRtpEncodingParameters>        encodings;
         sequence<RTCRtpHeaderExtensionParameters> headerExtensions;
         RTCRtcpParameters                         rtcp;
         sequence<RTCRtpCodecParameters>           codecs;
       };
 
       dictionary RTCRtpEncodingParameters {
         boolean             active;
-        RTCPriorityType     priority;
-        RTCPriorityType     networkPriority;
         unsigned long       maxBitrate;
 
         [readonly]
         DOMString           rid;
 
         double              scaleResolutionDownBy;
       };
 
-      enum RTCPriorityType {
-        "very-low",
-        "low",
-        "medium",
-        "high"
-      };
-
       getParameters
         - encodings is set to the value of the [[send encodings]] internal slot.
    */
 
   /*
     5.1.  addTransceiver
       7. Create an RTCRtpSender with track, streams and sendEncodings and let sender
          be the result.
@@ -123,32 +114,28 @@
       - encodings is set to the value of the [[send encodings]] internal slot.
    */
   promise_test(async t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
     const { sender } = pc.addTransceiver('video', {
       sendEncodings: [{
         active: false,
-        priority: 'low',
-        networkPriority: 'low',
         maxBitrate: 8,
         maxFramerate: 25,
         rid: 'foo'
       }]
     });
     await doOfferAnswerExchange(t, pc);
 
     const param = sender.getParameters();
     validateSenderRtpParameters(param);
     const encoding = getFirstEncoding(param);
 
     assert_equals(encoding.active, false);
-    assert_equals(encoding.priority, 'low');
-    assert_equals(encoding.networkPriority, 'low');
     assert_equals(encoding.maxBitrate, 8);
     assert_not_own_property(encoding, "rid", "rid should be removed with a single encoding");
 
   }, `sender.getParameters() should return sendEncodings set by addTransceiver()`);
 
   /*
     5.2.  setParameters
       3.  Let N be the number of RTCRtpEncodingParameters stored in sender's internal
@@ -254,21 +241,15 @@
 
       assert_approx_equals(encoding.scaleResolutionDownBy, 1.5, 0.01);
     });
   }, `setParameters() with encoding.scaleResolutionDownBy field set to greater than 1.0 should succeed`);
 
   test_modified_encoding('audio', 'active', false, true,
     'setParameters() with modified encoding.active should succeed');
 
-  test_modified_encoding('audio', 'priority', 'very-low', 'high',
-    'setParameters() with modified encoding.priority should succeed');
-
-  test_modified_encoding('audio', 'networkPriority', 'very-low', 'high',
-    'setParameters() with modified encoding.networkPriority should succeed');
-
   test_modified_encoding('audio', 'maxBitrate', 10000, 20000,
     'setParameters() with modified encoding.maxBitrate should succeed');
 
   test_modified_encoding('video', 'scaleResolutionDownBy', 2, 4,
     'setParameters() with modified encoding.scaleResolutionDownBy should succeed');
 
 </script>