Commit 1bb87260 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Test 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/968927Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544804}
parent 47450eea
......@@ -5,5 +5,6 @@ FAIL insertDTMF() should throw InvalidStateError if transceiver is stopped pc.ad
FAIL insertDTMF() should throw InvalidStateError if transceiver.currentDirection is recvonly pc.addTransceiver is not a function
FAIL insertDTMF() should throw InvalidStateError if transceiver.currentDirection is inactive pc.addTransceiver is not a function
PASS insertDTMF() should set toneBuffer to provided tones normalized, with old tones overridden
PASS insertDTMF() after remove and close should reject
Harness: the test ran to completion.
......@@ -162,4 +162,22 @@
});
}, '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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment