content/base/test/test_bug592829.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug592829.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=592829
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 592829</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=592829">Mozilla Bug 592829</a>
    1.16 +<pre id="test">
    1.17 +<script type="application/javascript">
    1.18 +/** Test for Bug 592829 **/
    1.19 +
    1.20 +// NOTE! It's imperative that we don't call .init() here. Otherwise we're not
    1.21 +// testing what happens if parsing fails.
    1.22 +// If we ever change how DOMParser initilization works, just update this code
    1.23 +// to create a DOMParser which is not allowed to parse XUL.
    1.24 +
    1.25 +var isXUL = true;
    1.26 +try {
    1.27 +  var x =
    1.28 +    SpecialPowers.Cc
    1.29 +      .getService(Components.interfaces.nsIDOMParser)
    1.30 +      .parseFromString('<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>', "text/xml");
    1.31 +  isXUL = x.documentElement.namespaceURI ==
    1.32 +    "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    1.33 +}
    1.34 +catch (ex) {
    1.35 +  isXUL = false;
    1.36 +}
    1.37 +
    1.38 +is(isXUL, false, "We didn't create XUL and we didn't crash!");
    1.39 +</script>
    1.40 +</pre>
    1.41 +</body>
    1.42 +</html>

mercurial