test_peerConnection_bug1773067.html (733B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <script type="application/javascript" src="pc.js"></script> 5 </head> 6 <body> 7 <pre id="test"> 8 <script type="application/javascript"> 9 createHTML({ 10 bug: "1773067", 11 title: "getStats on a closed peer connection should fail, not hang, " + 12 " until bug 1056433 is fixed" 13 }); 14 15 // TODO: Bug 1056433 removes the need for this test 16 runNetworkTest(async function () { 17 let errorName; 18 try { 19 const pc = new RTCPeerConnection(); 20 pc.close(); 21 await pc.getStats(); 22 } catch(e) { 23 errorName = e.name; 24 } 25 is(errorName, 26 "InvalidStateError", 27 "getStats on closed peer connection fails instead of hanging"); 28 }); 29 </script> 30 </pre> 31 </body> 32 </html>