dom/xbl/test/test_bug872273.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/test/test_bug872273.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=872273
     1.7 +-->
     1.8 +<head>
     1.9 +  <bindings xmlns="http://www.mozilla.org/xbl">
    1.10 +    <binding id="foo">
    1.11 +      <implementation>
    1.12 +        <method name="throwSomething" exposeToUntrustedContent="true">
    1.13 +          <body>
    1.14 +            throw new Error("foopy");
    1.15 +          </body>
    1.16 +        </method>
    1.17 +      </implementation>
    1.18 +    </binding>
    1.19 +  </bindings>
    1.20 +  <title>Test for Bug 872273</title>
    1.21 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.22 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.23 +</head>
    1.24 +<body>
    1.25 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=872273">Mozilla Bug 872273</a>
    1.26 +<p id="display" style="-moz-binding: url(#foo)"></p>
    1.27 +<div id="content" style="display: none">
    1.28 +</div>
    1.29 +<pre id="test">
    1.30 +<script type="application/javascript">
    1.31 +<![CDATA[
    1.32 +
    1.33 +/** Test for Bug 872273 **/
    1.34 +SimpleTest.waitForExplicitFinish();
    1.35 +addLoadEvent(function() {
    1.36 +
    1.37 +  // Prevent the test from failing when the exception hits onerror.
    1.38 +  SimpleTest.expectUncaughtException();
    1.39 +
    1.40 +  // Tell the test to expect exactly one console error with the given parameters,
    1.41 +  // with SimpleTest.finish as a continuation function.
    1.42 +  SimpleTest.monitorConsole(SimpleTest.finish, [{errorMessage: new RegExp('foopy')}]);
    1.43 +
    1.44 +  // Schedule the console accounting (and continuation) to run next, right
    1.45 +  // after we throw (below).
    1.46 +  SimpleTest.executeSoon(SimpleTest.endMonitorConsole);
    1.47 +
    1.48 +  // Throw.
    1.49 +  $('display').throwSomething();
    1.50 +});
    1.51 +
    1.52 +]]>
    1.53 +</script>
    1.54 +</pre>
    1.55 +</body>
    1.56 +</html>

mercurial