Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/base/test/chrome/chrome.toml
<?xml version="1.0"?>
                 type="text/css"?>
<!--
-->
  <!-- test results are displayed in the html:body -->
  </body>
  <!-- test code goes here -->
  <script type="application/javascript"><![CDATA[
  function endTest() {
    ok(document.getElementById('b').contentDocument.documentElement.textContent ==
       "succeeded", "Wrong URL loaded!");
    SimpleTest.finish();
  }
  function startTest() {
    const observer = new MutationObserver(() => {
      document.getElementById('b').setAttribute("src",
                                                "data:text/plain,failed");
      const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
      document.getElementById('b').loadURI(Services.io.newURI('data:text/plain,succeeded'), {
        triggeringPrincipal: systemPrincipal
      });
      document.getElementById('b').addEventListener("load", endTest);
    });
    observer.observe(document.documentElement, { attributes: true });
    document.documentElement.setAttribute("foo", "bar");
  }
  SimpleTest.waitForExplicitFinish();
  addLoadEvent(startTest);
  ]]></script>
  <browser flex="1" id="b"/>
</window>