| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description("Tests RTCPeerConnection createOffer."); | 8 description("Tests RTCPeerConnection createOffer."); |
| 9 | 9 |
| 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 of true
. | 11 // voiceActivityDetection and iceRestart options are passed with a value of true |
| 12 // In all other cases, createOffer() fails in the test runner. | 12 // and offerToReceiveAudio and offerToReceiveVideo are passed with a positive |
| 13 // value. In all other cases, createOffer() fails in the test runner. |
| 13 | 14 |
| 14 var pc = null; | 15 var pc = null; |
| 15 | 16 |
| 16 function unexpectedCallback() | 17 function unexpectedCallback() |
| 17 { | 18 { |
| 18 testFailed('unexpectedCallback was called') | 19 testFailed('unexpectedCallback was called') |
| 19 finishJSTest(); | 20 finishJSTest(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 function expectedCreateOfferFailed7(error) | 23 function expectedCreateOfferFailed7(error) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 48 function createOfferSucceeded2() { | 49 function createOfferSucceeded2() { |
| 49 testPassed('createOfferSucceeded2 was called.'); | 50 testPassed('createOfferSucceeded2 was called.'); |
| 50 shouldNotThrow("pc.createOffer(unexpectedCallback, expectedCreateOfferFailed
5, {offerToReceiveVideo:1, offerToReceiveAudio:0, voiceActivityDetection:false,
iceRestart:true});"); | 51 shouldNotThrow("pc.createOffer(unexpectedCallback, expectedCreateOfferFailed
5, {offerToReceiveVideo:1, offerToReceiveAudio:0, voiceActivityDetection:false,
iceRestart:true});"); |
| 51 } | 52 } |
| 52 | 53 |
| 53 function expectedCreateOfferFailed4(error) { | 54 function expectedCreateOfferFailed4(error) { |
| 54 testPassed('expectedCreateOfferFailed4 was called.'); | 55 testPassed('expectedCreateOfferFailed4 was called.'); |
| 55 window.error = error; | 56 window.error = error; |
| 56 shouldBe('error.name', '"OperationError"'); | 57 shouldBe('error.name', '"OperationError"'); |
| 57 shouldBe('error.toString()', '"OperationError: TEST_ERROR"'); | 58 shouldBe('error.toString()', '"OperationError: TEST_ERROR"'); |
| 58 shouldNotThrow("pc.createOffer(createOfferSucceeded2, unexpectedCallback, {i
ceRestart:true});"); | 59 shouldNotThrow("pc.createOffer(createOfferSucceeded2, unexpectedCallback, {i
ceRestart:true, offerToReceiveAudio:1, offerToReceiveVideo:1});"); |
| 59 } | 60 } |
| 60 | 61 |
| 61 function expectedCreateOfferFailed3(error) { | 62 function expectedCreateOfferFailed3(error) { |
| 62 testPassed('expectedCreateOfferFailed3 was called.'); | 63 testPassed('expectedCreateOfferFailed3 was called.'); |
| 63 window.error = error; | 64 window.error = error; |
| 64 shouldBe('error.name', '"OperationError"'); | 65 shouldBe('error.name', '"OperationError"'); |
| 65 shouldBe('error.toString()', '"OperationError: TEST_ERROR"'); | 66 shouldBe('error.toString()', '"OperationError: TEST_ERROR"'); |
| 66 shouldNotThrow("pc.createOffer(unexpectedCallback, expectedCreateOfferFailed
4, {voiceActivityDetection:false});"); | 67 shouldNotThrow("pc.createOffer(unexpectedCallback, expectedCreateOfferFailed
4, {voiceActivityDetection:false});"); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 window.events[counter++] = 2; | 106 window.events[counter++] = 2; |
| 106 }); | 107 }); |
| 107 Promise.resolve().then(_ => { | 108 Promise.resolve().then(_ => { |
| 108 window.events[counter++] = 3; | 109 window.events[counter++] = 3; |
| 109 shouldBe('events', '[1,2,3]'); | 110 shouldBe('events', '[1,2,3]'); |
| 110 }); | 111 }); |
| 111 } | 112 } |
| 112 | 113 |
| 113 shouldNotThrow('testExecutionOrderClosedConnection()'); | 114 shouldNotThrow('testExecutionOrderClosedConnection()'); |
| 114 pc = new webkitRTCPeerConnection(null); | 115 pc = new webkitRTCPeerConnection(null); |
| 115 shouldNotThrow('pc.createOffer(createOfferSucceeded1, unexpectedCallback, {voice
ActivityDetection:true, iceRestart:true});'); | 116 shouldNotThrow('pc.createOffer(createOfferSucceeded1, unexpectedCallback, {voice
ActivityDetection:true, iceRestart:true, offerToReceiveAudio:1, offerToReceiveVi
deo:1});'); |
| 116 | 117 |
| 117 window.jsTestIsAsync = true; | 118 window.jsTestIsAsync = true; |
| 118 window.successfullyParsed = true; | 119 window.successfullyParsed = true; |
| 119 </script> | 120 </script> |
| 120 </body> | 121 </body> |
| 121 </html> | 122 </html> |
| OLD | NEW |