tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug592829.html (1209B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=592829
      5 -->
      6 <head>
      7  <title>Test for Bug 592829</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=592829">Mozilla Bug 592829</a>
     13 <pre id="test">
     14 <script type="application/javascript">
     15 /** Test for Bug 592829 */
     16 
     17 // NOTE! It's imperative that we don't call .init() here. Otherwise we're not
     18 // testing what happens if parsing fails.
     19 // If we ever change how DOMParser initilization works, just update this code
     20 // to create a DOMParser which is not allowed to parse XUL.
     21 
     22 var isXUL = true;
     23 var parser = SpecialPowers.getNoXULDOMParser();
     24 ok(parser, "Should get a parser!");
     25 
     26 try {
     27  var x = parser
     28    .parseFromString('<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>', "text/xml");
     29  isXUL = x.documentElement.namespaceURI ==
     30    "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     31 }
     32 catch (ex) {
     33  isXUL = false;
     34 }
     35 
     36 is(isXUL, false, "We didn't create XUL and we didn't crash!");
     37 </script>
     38 </pre>
     39 </body>
     40 </html>