Bug 1447311 [wpt PR 10109] - Test that DTMFSender rejects properly after close, a=testonly
authorHarald Alvestrand <hta@chromium.org>
Mon, 09 Apr 2018 17:33:56 +0000
changeset 413556 f1ae575304aed05255c5e9a01f80eac23c040be4
parent 413555 9ebc5087f2d403ae12d97d0666f0610991aa6554
child 413557 16ff4c621513bc0afee6019e7321a94c7e813a4e
push id102161
push userjames@hoppipolla.co.uk
push dateSun, 15 Apr 2018 09:10:16 +0000
treeherdermozilla-inbound@ebfad4be630d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1447311, 10109, 822799, 968927, 544804
milestone61.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 1447311 [wpt PR 10109] - Test that DTMFSender rejects properly after close, a=testonly Automatic update from web-platform-testsTest that DTMFSender rejects properly after close This verifies that the sender throws the right error when called after the connection closing. Bug: chromium:822799 Change-Id: Id3ab4ddc65b1510526fa49b7bfe3f9f95a7f2d65 Reviewed-on: https://chromium-review.googlesource.com/968927 Reviewed-by: Henrik Boström <hbos@chromium.org> Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/master@{#544804} wpt-commits: b1ef882561da6110852ba6f96f2043a24d00dcb7 wpt-pr: 10109 wpt-commits: b1ef882561da6110852ba6f96f2043a24d00dcb7 wpt-pr: 10109
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -603245,17 +603245,17 @@
    "a9beda60053916185106aedac98014123d6f7105",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-helper.js": [
    "26b5336881897c93fafd1ddf32910cf6fef16987",
    "support"
   ],
   "webrtc/RTCDTMFSender-insertDTMF.https.html": [
-   "591337627bf4bd0e40e6a5660efa9fc1e320d89f",
+   "79574cff7e0500cecaf7e3ae182e89d98f49ce72",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-ontonechange-long.https.html": [
    "d89602fd655bf032cadfc538291ccea858eb2446",
    "testharness"
   ],
   "webrtc/RTCDTMFSender-ontonechange.https.html": [
    "4f53cbc7fafeeed5202774b58d4bf721055b382e",
--- a/testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
+++ b/testing/web-platform/tests/webrtc/RTCDTMFSender-insertDTMF.https.html
@@ -157,9 +157,27 @@
       dtmfSender.insertDTMF('ABC');
       assert_equals(dtmfSender.toneBuffer, 'ABC');
 
       dtmfSender.insertDTMF('bcd');
       assert_equals(dtmfSender.toneBuffer, 'BCD');
     });
   }, 'insertDTMF() should set toneBuffer to provided tones normalized, with old tones overridden');
 
+  promise_test(t => {
+    let dtmfSender;
+    let sender;
+    let pc = new RTCPeerConnection();
+    return getTrackFromUserMedia('audio')
+      .then(([track, mediaStream]) => {
+        sender = pc.addTrack(track, mediaStream);
+        return pc.createOffer();
+      }).then(offer => {
+        pc.setLocalDescription(offer);
+        dtmfSender = sender.dtmf;
+        pc.removeTrack(sender);
+        pc.close();
+        assert_throws('InvalidStateError', () =>
+                      dtmfSender.insertDTMF('123'));
+      });
+  }, 'insertDTMF() after remove and close should reject');
+
 </script>