OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>RTCPeerConnection.createOffer</title> | 4 <title>RTCPeerConnection.createOffer</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <script> | 9 <script> |
10 // Note: createOffer() calls in the test runner are successful if the | 10 // Note: createOffer() calls in the test runner are successful if the |
11 // voiceActivityDetection and iceRestart options are passed with a value | 11 // voiceActivityDetection and iceRestart options are passed with a value |
12 // of true and offerToReceiveAudio and offerToReceiveVideo are passed with | 12 // of true and offerToReceiveAudio and offerToReceiveVideo are passed with |
13 // a positive value. In all other cases, createOffer() fails in the test | 13 // a positive value. In all other cases, createOffer() fails in the test |
14 // runner. | 14 // runner. |
15 | 15 |
16 defaultError = new DOMException('TEST_ERROR', 'OperationError') | 16 defaultError = new DOMException('TEST_ERROR', 'OperationError') |
17 pc = new webkitRTCPeerConnection(null); | 17 pc = new RTCPeerConnection(); |
18 | 18 |
19 // Test that creating an offer with voiceActivityDetection, iceRestart, | 19 // Test that creating an offer with voiceActivityDetection, iceRestart, |
20 // offerToReceiveAudio and offerToReceiveVideo returns an accepted promise
. | 20 // offerToReceiveAudio and offerToReceiveVideo returns an accepted promise
. |
21 promise_test(function() { | 21 promise_test(function() { |
22 return pc.createOffer({voiceActivityDetection:true, iceRestart:true, off
erToReceiveAudio:1, offerToReceiveVideo:1}) | 22 return pc.createOffer({voiceActivityDetection:true, iceRestart:true, off
erToReceiveAudio:1, offerToReceiveVideo:1}) |
23 }, 'createOffer({voiceActivityDetection:true, iceRestart:true})'); | 23 }, 'createOffer({voiceActivityDetection:true, iceRestart:true})'); |
24 | 24 |
25 // Test that not explicitly setting voiceActivityDetection results in an | 25 // Test that not explicitly setting voiceActivityDetection results in an |
26 // accepted promise, since the default value for voiceActivityDetection | 26 // accepted promise, since the default value for voiceActivityDetection |
27 // is true. | 27 // is true. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 promise_test(function() { | 62 promise_test(function() { |
63 return promise_rejects(this, defaultError, pc.createOffer()); | 63 return promise_rejects(this, defaultError, pc.createOffer()); |
64 }, 'createOffer()' ); | 64 }, 'createOffer()' ); |
65 | 65 |
66 // Test type error | 66 // Test type error |
67 promise_test(function() { | 67 promise_test(function() { |
68 return promise_rejects(this, new TypeError(), pc.createOffer(1)); | 68 return promise_rejects(this, new TypeError(), pc.createOffer(1)); |
69 }, 'createOffer(1)' ); | 69 }, 'createOffer(1)' ); |
70 | 70 |
71 // Test closed connection | 71 // Test closed connection |
72 closedPC = new webkitRTCPeerConnection(null); | 72 closedPC = new RTCPeerConnection(); |
73 closedPC.close(); | 73 closedPC.close(); |
74 promise_test(function() { | 74 promise_test(function() { |
75 var invalidStateError = new DOMException('', 'InvalidStateError'); | 75 var invalidStateError = new DOMException('', 'InvalidStateError'); |
76 return promise_rejects(this, invalidStateError, closedPC.createOffer({ic
eRestart:true})); | 76 return promise_rejects(this, invalidStateError, closedPC.createOffer({ic
eRestart:true})); |
77 }, 'createOffer() with closed peer connection' ); | 77 }, 'createOffer() with closed peer connection' ); |
78 </script> | 78 </script> |
79 </body> | 79 </body> |
80 </html> | 80 </html> |
OLD | NEW |