dom/xbl/test/test_bug872273.xhtml

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 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=872273
     4 -->
     5 <head>
     6   <bindings xmlns="http://www.mozilla.org/xbl">
     7     <binding id="foo">
     8       <implementation>
     9         <method name="throwSomething" exposeToUntrustedContent="true">
    10           <body>
    11             throw new Error("foopy");
    12           </body>
    13         </method>
    14       </implementation>
    15     </binding>
    16   </bindings>
    17   <title>Test for Bug 872273</title>
    18   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    19   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    20 </head>
    21 <body>
    22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=872273">Mozilla Bug 872273</a>
    23 <p id="display" style="-moz-binding: url(#foo)"></p>
    24 <div id="content" style="display: none">
    25 </div>
    26 <pre id="test">
    27 <script type="application/javascript">
    28 <![CDATA[
    30 /** Test for Bug 872273 **/
    31 SimpleTest.waitForExplicitFinish();
    32 addLoadEvent(function() {
    34   // Prevent the test from failing when the exception hits onerror.
    35   SimpleTest.expectUncaughtException();
    37   // Tell the test to expect exactly one console error with the given parameters,
    38   // with SimpleTest.finish as a continuation function.
    39   SimpleTest.monitorConsole(SimpleTest.finish, [{errorMessage: new RegExp('foopy')}]);
    41   // Schedule the console accounting (and continuation) to run next, right
    42   // after we throw (below).
    43   SimpleTest.executeSoon(SimpleTest.endMonitorConsole);
    45   // Throw.
    46   $('display').throwSomething();
    47 });
    49 ]]>
    50 </script>
    51 </pre>
    52 </body>
    53 </html>

mercurial