tor-browser

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

test_custom_element_ep.xhtml (1688B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
      3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
      4                 type="text/css"?>
      5 <!--
      6 https://bugzilla.mozilla.org/show_bug.cgi?id=1130028
      7 -->
      8 <window title="Mozilla Bug 1130028"
      9  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     10  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     11 
     12  <!-- test results are displayed in the html:body -->
     13  <body xmlns="http://www.w3.org/1999/xhtml">
     14  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1130028"
     15     target="_blank">Mozilla Bug 1130028</a>
     16  <iframe onload="startTests()" id="frame" src="http://example.com/chrome/dom/base/test/chrome/frame_custom_element_content.html"></iframe>
     17  </body>
     18 
     19  <!-- test code goes here -->
     20  <script type="application/javascript"><![CDATA[
     21 
     22  /** Test for Bug 1130028 */
     23  SimpleTest.waitForExplicitFinish();
     24 
     25  function finishTest(canSeePrototype) {
     26    ok(true, "connectedCallback called when reigsterElement was called with an extended principal.");
     27    ok(canSeePrototype, "connectedCallback should be able to see custom prototype.");
     28    SimpleTest.finish();
     29  }
     30 
     31  function startTests() {
     32    var frame = $("frame");
     33 
     34    // Create a sandbox with an extended principal then run a script that registers a custom element in the sandbox.
     35    var sandbox = Cu.Sandbox([frame.contentWindow], { sandboxPrototype: frame.contentWindow });
     36    sandbox.finishTest = finishTest;
     37    Services.scriptloader.loadSubScript("chrome://mochitests/content/chrome/dom/base/test/chrome/custom_element_ep.js", sandbox);
     38  }
     39 
     40  ]]></script>
     41 </window>