| Soares Chen | 172fe9d | 2017-07-18 09:30:18 | [diff] [blame] | 1 | <!doctype html> | 
|  | 2 | <meta charset=utf-8> | 
|  | 3 | <title>RTCRtpSender.prototype.setParameters</title> | 
|  | 4 | <script src="/resources/testharness.js"></script> | 
|  | 5 | <script src="/resources/testharnessreport.js"></script> | 
|  | 6 | <script> | 
|  | 7 | 'use strict'; | 
|  | 8 |  | 
|  | 9 | // Test is based on the following editor draft: | 
|  | 10 | // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html | 
|  | 11 |  | 
|  | 12 | /* | 
|  | 13 | 5.2. setParameters | 
|  | 14 | 6. If transceiver.stopped is true, abort these steps and return a promise | 
|  | 15 | rejected with a newly created InvalidStateError. | 
|  | 16 | */ | 
|  | 17 | promise_test(t => { | 
|  | 18 | const pc = new RTCPeerConnection(); | 
|  | 19 | const transceiver = pc.addTransceiver('audio'); | 
|  | 20 | const { sender } = transceiver; | 
|  | 21 |  | 
|  | 22 | const param = sender.getParameters(); | 
|  | 23 | transceiver.stop(); | 
|  | 24 |  | 
|  | 25 | return promise_rejects(t, 'InvalidStateError', | 
|  | 26 | sender.setParameters(param)); | 
|  | 27 |  | 
|  | 28 | }, `setParameters() when transceiver is stopped should reject with InvalidStateError`); | 
|  | 29 |  | 
|  | 30 | </script> |