1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bindings/test/test_exceptions_from_jsimplemented.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=923010 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 923010</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + /** Test for Bug 923010 **/ 1.16 + try { 1.17 + var conn = new mozRTCPeerConnection(); 1.18 + try { 1.19 + conn.createAnswer(function() { 1.20 + ok(false, "The call to createAnswer succeeded when it should have thrown"); 1.21 + }, function() { 1.22 + ok(false, "The call to createAnswer failed when it should have thrown"); 1.23 + }, { "mandatory": { "BOGUS": 5 } } ) 1.24 + ok(false, "That call to createAnswer should have thrown"); 1.25 + } catch (e) { 1.26 + is(e.lineNumber, 20, "Exception should have been on line 20"); 1.27 + is(e.message, 1.28 + "createAnswer passed invalid constraints - unknown mandatory constraint: BOGUS", 1.29 + "Should have the exception we expect"); 1.30 + } 1.31 + } catch (e) { 1.32 + // b2g has no WebRTC, apparently 1.33 + todo(false, "No WebRTC on b2g yet"); 1.34 + } 1.35 + </script> 1.36 +</head> 1.37 +<body> 1.38 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=923010">Mozilla Bug 923010</a> 1.39 +<p id="display"></p> 1.40 +<div id="content" style="display: none"> 1.41 + 1.42 +</div> 1.43 +<pre id="test"> 1.44 +</pre> 1.45 +</body> 1.46 +</html>