Bug 1459903 [wpt PR 10893] - webrtc wpt: pass test function in more tests, a=testonly
authorPhilipp Hancke <philipp.hancke@googlemail.com>
Tue, 15 May 2018 13:30:12 +0000
changeset 418485 7142ea1ef1d646980cc33a2960ebcb0fa94a54f8
parent 418484 96819f2142ae4142d3661a49e0423c7791be6433
child 418486 816d4ef0a3dea89726812659ab06b401a4d7f94e
push id103318
push userwptsync@mozilla.com
push dateWed, 16 May 2018 15:06:09 +0000
treeherdermozilla-inbound@51f1ecd79ebe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1459903, 10893, 1047674, 836871, 1049865, 556795
milestone62.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 1459903 [wpt PR 10893] - webrtc wpt: pass test function in more tests, a=testonly Automatic update from web-platform-testswebrtc wpt: pass test function in more tests passes the test argument in promise_test and async_test so it can be used to add cleanup. followup on https://chromium-review.googlesource.com/c/chromium/src/+/1047674 using the same codemod but a better, non-regexp way to extract the script tag content. BUG=836871 Change-Id: I41905ce25e22121a6e8b53d37af86b073e020b5c Reviewed-on: https://chromium-review.googlesource.com/1049865 Reviewed-by: Harald Alvestrand <hta@chromium.org> Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/master@{#556795} -- wpt-commits: 45f9422369ebb560e1705f2c8769bf2ea44ee56e wpt-pr: 10893
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
testing/web-platform/tests/webrtc/RTCIceTransport.html
testing/web-platform/tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html
testing/web-platform/tests/webrtc/RTCPeerConnection-peerIdentity.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setDescription-transceiver.html
testing/web-platform/tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html
testing/web-platform/tests/webrtc/RTCRtpSender-getStats.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -613738,17 +613738,17 @@
    "a9beda60053916185106aedac98014123d6f7105",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-helper.js": [
    "26b5336881897c93fafd1ddf32910cf6fef16987",
    "support"
   ],
   "webrtc/RTCDTMFSender-insertDTMF.https.html": [
-   "79574cff7e0500cecaf7e3ae182e89d98f49ce72",
+   "a5fc15d44fe572744c07d933b9204d9319c968cd",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-ontonechange-long.https.html": [
    "d89602fd655bf032cadfc538291ccea858eb2446",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-ontonechange.https.html": [
    "ecc1e77f083cb91af78b1bcb7311fe4b5b96313e",
@@ -613774,33 +613774,33 @@
    "7d6ea59253879cac114e2a7b162fa67926a39635",
    "testharness"
   ],
   "webrtc/RTCIceCandidate-constructor.html": [
    "6938c88a0167e418aa9e93416865c857cc3489c5",
    "testharness"
   ],
   "webrtc/RTCIceTransport.html": [
-   "c145a8a34c79dd970475e77ff5bf1a363c0ac56c",
+   "db758cc2a744c049c291575e408dbb5f280cdf19",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-addIceCandidate.html": [
    "dd19f1d7a8d12ee85101e53bb30c553e94d67b6a",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-addTrack.https.html": [
    "c434d2cdcb134f28b203df07cecca04e11195700",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-addTransceiver.html": [
    "c2d5766daa3ea4050ccb2777d7c08af1a1bd176f",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-canTrickleIceCandidates.html": [
-   "0f585a89bd8f25aa8f83b6ec39b704cbb8e970b2",
+   "8401fdc22f8f8867aa361f6a83834cdeb7a2a9d1",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-connectionState.html": [
    "a733cd1ae59aace10832a7b5f98913967afb87f1",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-constructor.html": [
    "c229347757f56d239925915ed9e6227086e75b84",
@@ -613830,17 +613830,17 @@
    "208bb45887440df3bf1e45dd63f09d2d5b70857d",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-getIdentityAssertion.html": [
    "91b55a4f1d9a10cda7cb0e11ba42243bf94a0dfa",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-getStats.https.html": [
-   "9446d7bc1aefa7edd28b425415d983d69311e0ca",
+   "913cbc3d2aaf724e70108e7854f56ad5bb9b2283",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-getTransceivers.html": [
    "b4c97af4f907a3d02fe1ebd24f00ab110b387575",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-helper.js": [
    "d579dd68118d72c06455d8ccdbeb666f8f39c58a",
@@ -613862,25 +613862,25 @@
    "ca1cbd230de7aec4844879ae43f822941f566620",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-ontrack.https.html": [
    "3db4d8b29f4e1372055a50a279cae525f52cbb40",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-peerIdentity.html": [
-   "1cc5702e0aee887d925d2bf3471ac759d7430874",
+   "5aa9f3d712dd320cc85645abd39f960b5072349b",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-removeTrack.https.html": [
    "561575bea206ec1c9572e1e5e6f97d1e0bebe2d1",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-setDescription-transceiver.html": [
-   "0f998108088cee211977870f9c64f2a89bef7bf0",
+   "a21fe04592ad6941aa4277535d6482519b67ae74",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-setLocalDescription-answer.html": [
    "e215aa042c67a23ae776b83d662a035a22e03810",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-setLocalDescription-offer.html": [
    "117fc91599d11b63f2d232a63bace8e367dbb72a",
@@ -613978,25 +613978,25 @@
    "ed910cbe15534cae43b79cc008395bd62fbd0637",
    "testharness"
   ],
   "webrtc/RTCRtpReceiver-getStats.https.html": [
    "ac5c0244fe64a5c07a7d255003c783e27a699728",
    "testharness"
   ],
   "webrtc/RTCRtpReceiver-getSynchronizationSources.https.html": [
-   "56d0157f4ce987436c12ddff886b74549abbe682",
+   "11aa1d9f6833dd019ae7ade7b9ec14780f271650",
    "testharness"
   ],
   "webrtc/RTCRtpSender-getCapabilities.html": [
    "27f083617973770f0d42efb93813f0112fc68ad2",
    "testharness"
   ],
   "webrtc/RTCRtpSender-getStats.https.html": [
-   "64c4424e36c566294a317fb423eb02e97a9ebbca",
+   "ee215306e1d9d1fdcb65bd5244da09fb2005e799",
    "testharness"
   ],
   "webrtc/RTCRtpSender-replaceTrack.html": [
    "f7b8caa578c9c818e8ca11777daf664ccb9457ec",
    "testharness"
   ],
   "webrtc/RTCRtpSender-setParameters.html": [
    "615bd9591e0f9c873827c9ae8e787b12d2efaf0f",
--- a/testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
+++ b/testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
@@ -143,17 +143,17 @@
 
   /*
     7.2.  insertDTMF
       The characters a to d MUST be normalized to uppercase on entry and are
       equivalent to A to D.
 
       7.  Set the object's toneBuffer attribute to tones.
    */
-  promise_test(() => {
+  promise_test(t => {
     return createDtmfSender()
     .then(dtmfSender => {
       dtmfSender.insertDTMF('123');
       assert_equals(dtmfSender.toneBuffer, '123');
 
       dtmfSender.insertDTMF('ABC');
       assert_equals(dtmfSender.toneBuffer, 'ABC');
 
--- a/testing/web-platform/tests/webrtc/RTCIceTransport.html
+++ b/testing/web-platform/tests/webrtc/RTCIceTransport.html
@@ -113,17 +113,17 @@
 
     assert_true(candidatePair.remote instanceof RTCIceCandidate,
       'Expect candidatePair.remote to be instance of RTCIceCandidate');
 
     validateCandidateParameter(iceTransport.getLocalParameters());
     validateCandidateParameter(iceTransport.getRemoteParameters());
   }
 
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
 
     return createDataChannelPair(pc1, pc2)
     .then(([channel1, channel2]) => {
       // Send a ping message and wait for it just to make sure
       // that the connection is fully working before testing
       channel1.send('ping');
@@ -158,17 +158,17 @@
       assert_equals(iceTransport1.role, 'controlling',
         `Expect offerer's iceTransport to take the controlling role`);
 
       assert_equals(iceTransport2.role, 'controlled',
         `Expect answerer's iceTransport to take the controlled role`);
     });
   }, 'Two connected iceTransports should has matching local/remote candidates returned');
 
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
     pc1.createDataChannel('');
 
     // setRemoteDescription(answer) without the other peer
     // setting answer it's localDescription
     return pc1.createOffer()
     .then(offer =>
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
@@ -30,26 +30,26 @@
       'a=ssrc:1001 cname:some\r\n' +
       'a=rtpmap:111 opus/48000/2\r\n';
 
   test(function() {
     var pc = new RTCPeerConnection();
     assert_equals(pc.canTrickleIceCandidates, null, 'canTrickleIceCandidates property is null');
   }, 'canTrickleIceCandidates property is null prior to setRemoteDescription');
 
-  promise_test(function() {
+  promise_test(function(t) {
     var pc = new RTCPeerConnection();
 
     return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp}))
     .then(function() {
       assert_true(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is true after setRemoteDescription');
     })
   }, 'canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle');
 
-  promise_test(function() {
+  promise_test(function(t) {
     var pc = new RTCPeerConnection();
 
     return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.replace('a=ice-options:trickle\r\n', '')}))
     .then(function() {
       assert_false(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is false after setRemoteDescription');
     })
   }, 'canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle');
 </script>
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-getStats.https.html
@@ -34,22 +34,22 @@
           If no such sender or receiver exists, or if more than one sender or
           receiver fit this criteria, return a promise rejected with a newly
           created InvalidAccessError.
       5.  Let p be a new promise.
       6.  Run the following steps in parallel:
         1.  Gather the stats indicated by selector according to the stats selection algorithm.
         2.  Resolve p with the resulting RTCStatsReport object, containing the gathered stats.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     return pc.getStats();
   }, 'getStats() with no argument should succeed');
 
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     return pc.getStats(null);
   }, 'getStats(null) should succeed');
 
   /*
     8.2.  getStats
       4.  If selectorArg is a MediaStreamTrack let selector be an RTCRtpSender
           or RTCRtpReceiver on connection which track member matches selectorArg.
@@ -155,17 +155,17 @@
   /*
     8.5.  The stats selection algorithm
       3.  If selector is an RTCRtpSender, gather stats for and add the following objects
           to result:
         - All RTCOutboundRTPStreamStats objects corresponding to selector.
         - All stats objects referenced directly or indirectly by the RTCOutboundRTPStreamStats
           objects added.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     return getTrackFromUserMedia('audio')
     .then(([track, mediaStream]) => {
       pc.addTrack(track, mediaStream);
 
       return pc.getStats(track)
       .then(statsReport => {
         validateStatsReport(statsReport);
@@ -178,17 +178,17 @@
   /*
     8.5.  The stats selection algorithm
       4.  If selector is an RTCRtpReceiver, gather stats for and add the following objects
           to result:
         - All RTCInboundRTPStreamStats objects corresponding to selector.
         - All stats objects referenced directly or indirectly by the RTCInboundRTPStreamStats
           added.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     const transceiver = pc.addTransceiver('audio');
 
     return pc.getStats(transceiver.receiver.track)
     .then(statsReport => {
       validateStatsReport(statsReport);
       assert_stats_report_has_stats(statsReport, ['inbound-rtp']);
     });
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-peerIdentity.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-peerIdentity.html
@@ -49,17 +49,17 @@
       validates the identity assertion..
 
       If the "peerIdentity" configuration is applied to the RTCPeerConnection, this
       establishes a target peer identity of the provided value. Alternatively, if the
       RTCPeerConnection has previously authenticated the identity of the peer (that
       is, there is a current value for peerIdentity ), then this also establishes a
       target peer identity.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
 
     const port = window.location.port;
     const [idpDomain] = getIdpDomains();
     const idpHost = hostString(idpDomain, port);
 
     pc1.setIdentityProvider(idpHost, {
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setDescription-transceiver.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setDescription-transceiver.html
@@ -59,17 +59,17 @@
       7.  If description is set as a local description, then run the following steps for
           each media description in description that is not yet associated with an
           RTCRtpTransceiver object:
         1.  Let transceiver be the RTCRtpTransceiver used to create the media
             description.
         2.  Set transceiver's mid value to the mid of the corresponding media
             description.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     const transceiver = pc.addTransceiver('audio');
     assert_equals(transceiver.mid, null);
 
     return pc.createOffer()
     .then(offer => {
       assert_equals(transceiver.mid, null,
         'Expect transceiver.mid to still be null after createOffer');
@@ -92,17 +92,17 @@
         2.  If no suitable transceiver is found (transceiver is unset), run the following
             steps:
           1.  Create an RTCRtpSender, sender, from the media description.
           2.  Create an RTCRtpReceiver, receiver, from the media description.
           3.  Create an RTCRtpTransceiver with sender, receiver and direction, and let
               transceiver be the result.
         3.  Set transceiver's mid value to the mid of the corresponding media description.
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
 
     const transceiver1 = pc1.addTransceiver('audio');
     assert_array_equals(pc1.getTransceivers(), [transceiver1]);
     assert_array_equals(pc2.getTransceivers(), []);
 
     return pc1.createOffer()
@@ -132,17 +132,17 @@
 
   /*
     4.3.1.6.  Set the RTCSessionSessionDescription
       9.  If description is of type "rollback", then run the following steps:
         1.  If the mid value of an RTCRtpTransceiver was set to a non-null value by
             the RTCSessionDescription that is being rolled back, set the mid value
             of that transceiver to null, as described by [JSEP] (section 4.1.8.2.).
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     const transceiver = pc.addTransceiver('audio');
     assert_equals(transceiver.mid, null);
 
     return pc.createOffer()
     .then(offer => {
       assert_equals(transceiver.mid, null);
       return pc.setLocalDescription(offer);
@@ -152,17 +152,17 @@
       return pc.setLocalDescription({ type: 'rollback' });
     })
     .then(() => {
       assert_equals(transceiver.mid, null,
       'Expect transceiver.mid to become null again after rollback');
     });
   }, 'setLocalDescription(rollback) should unset transceiver.mid');
 
-  promise_test(() => {
+  promise_test(t => {
     const pc = new RTCPeerConnection();
     const transceiver1 = pc.addTransceiver('audio');
     assert_equals(transceiver1.mid, null);
 
     return pc.createOffer()
     .then(offer =>
        pc.setLocalDescription(offer)
        .then(() => generateAnswer(offer)))
@@ -197,17 +197,17 @@
   /*
     4.3.1.6.  Set the RTCSessionSessionDescription
       9.  If description is of type "rollback", then run the following steps:
         2.  If an RTCRtpTransceiver was created by applying the RTCSessionDescription
             that is being rolled back, and a track has not been attached to it via
             addTrack, remove that transceiver from connection's set of transceivers,
             as described by [JSEP] (section 4.1.8.2.).
    */
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
 
     pc1.addTransceiver('audio');
 
     return pc1.createOffer()
     .then(offer => pc2.setRemoteDescription(offer))
     .then(() => {
--- a/testing/web-platform/tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html
+++ b/testing/web-platform/tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html
@@ -20,17 +20,17 @@
       interface RTCRtpSynchronizationSource {
         readonly attribute DOMHighResTimeStamp timestamp;
         readonly attribute unsigned long       source;
         readonly attribute byte                audioLevel;
         readonly attribute boolean?            voiceActivityFlag;
       };
    */
 
-  promise_test(() => {
+  promise_test(t => {
     const pc1 = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
 
     const ontrackPromise = new Promise(resolve => {
       pc2.addEventListener('track', trackEvent => {
         const { receiver } = trackEvent;
         assert_true(receiver instanceof RTCRtpReceiver,
           'Expect trackEvent.receiver to be instance of RTCRtpReceiver');
--- a/testing/web-platform/tests/webrtc/RTCRtpSender-getStats.https.html
+++ b/testing/web-platform/tests/webrtc/RTCRtpSender-getStats.https.html
@@ -34,28 +34,28 @@
     8.5. The stats selection algorithm
       3.  If selector is an RTCRtpSender, gather stats for and add the following objects
           to result:
         - All RTCOutboundRTPStreamStats objects corresponding to selector.
         - All stats objects referenced directly or indirectly by the RTCOutboundRTPStreamStats
           objects added.
    */
 
-  promise_test(async () => {
+  promise_test(async t => {
     const caller = new RTCPeerConnection();
     const callee = new RTCPeerConnection();
     const { sender } = caller.addTransceiver('audio');
 
     await doSignalingHandshake(caller, callee);
     const statsReport = await sender.getStats();
     validateStatsReport(statsReport);
     assert_stats_report_has_stats(statsReport, ['outbound-rtp']);
   }, 'sender.getStats() via addTransceiver should return stats report containing outbound-rtp stats');
 
-  promise_test(async () => {
+  promise_test(async t => {
     const caller = new RTCPeerConnection();
     const callee = new RTCPeerConnection();
     const stream = await navigator.mediaDevices.getUserMedia({audio:true});
     const [track] = stream.getTracks();
     const sender = caller.addTrack(track, stream);
 
     await doSignalingHandshake(caller, callee);
     const statsReport = await sender.getStats();