tor-browser

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

test_append_content_pre_dcl.html (948B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test L10n Mutations for ContentAppended before DOMContentLoaded</title>
      6  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
      8  <link rel="localization" href="crashreporter/aboutcrashes.ftl"/>
      9 </head>
     10 <body>
     11  <script type="application/javascript">
     12  "use strict";
     13  SimpleTest.waitForExplicitFinish();
     14 
     15  let elem = document.createElement("div");
     16  document.l10n.setAttributes(elem, "crash-reports-title");
     17  is(elem.textContent.length, 0);
     18  let verifyL10n = () => {
     19    if (elem.textContent.length) {
     20      window.removeEventListener("MozAfterPaint", verifyL10n);
     21      SimpleTest.finish();
     22    }
     23  };
     24  window.addEventListener("MozAfterPaint", verifyL10n);
     25  document.body.appendChild(elem);
     26  </script>
     27 </body>
     28 </html>