dom/bindings/test/test_exceptions_from_jsimplemented.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=923010
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 923010</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <script type="application/javascript">
    12   /** Test for Bug 923010 **/
    13   try {
    14     var conn = new mozRTCPeerConnection();
    15     try {
    16       conn.createAnswer(function() {
    17           ok(false, "The call to createAnswer succeeded when it should have thrown");
    18         }, function() {
    19           ok(false, "The call to createAnswer failed when it should have thrown");
    20         }, { "mandatory": { "BOGUS": 5 } } )
    21       ok(false, "That call to createAnswer should have thrown");
    22     } catch (e) {
    23       is(e.lineNumber, 20, "Exception should have been on line 20");
    24       is(e.message,
    25          "createAnswer passed invalid constraints - unknown mandatory constraint: BOGUS",
    26          "Should have the exception we expect");
    27     }
    28   } catch (e) {
    29     // b2g has no WebRTC, apparently
    30     todo(false, "No WebRTC on b2g yet");
    31   }
    32   </script>
    33 </head>
    34 <body>
    35 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=923010">Mozilla Bug 923010</a>
    36 <p id="display"></p>
    37 <div id="content" style="display: none">
    39 </div>
    40 <pre id="test">
    41 </pre>
    42 </body>
    43 </html>

mercurial