tor-browser

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

test_append_content_post_dcl.html (1036B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test L10n Mutations for ContentAppended after 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  <script type="application/javascript">
     10  "use strict";
     11  SimpleTest.waitForExplicitFinish();
     12 
     13  document.addEventListener("DOMContentLoaded", function() {
     14    let elem = document.createElement("div");
     15    document.l10n.setAttributes(elem, "crash-reports-title");
     16    is(elem.textContent.length, 0);
     17    let verifyL10n = () => {
     18      if (elem.textContent.length) {
     19        window.removeEventListener("MozAfterPaint", verifyL10n);
     20        SimpleTest.finish();
     21      }
     22    };
     23    window.addEventListener("MozAfterPaint", verifyL10n);
     24    document.body.appendChild(elem);
     25  });
     26  </script>
     27 </head>
     28 <body>
     29 </body>
     30 </html>