summaryrefslogtreecommitdiffstats
path: root/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_post_dcl.html
blob: e3a9819728dc29305847b4501b9f1484a06d2692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test L10n Mutations for ContentAppended after DOMContentLoaded</title>
  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
  <link rel="localization" href="crashreporter/aboutcrashes.ftl"/>
  <script type="application/javascript">
  "use strict";
  SimpleTest.waitForExplicitFinish();

  document.addEventListener("DOMContentLoaded", function() {
    let elem = document.createElement("div");
    document.l10n.setAttributes(elem, "crash-reports-title");
    is(elem.textContent.length, 0);
    let verifyL10n = () => {
      if (elem.textContent.length) {
        window.removeEventListener("MozAfterPaint", verifyL10n);
        SimpleTest.finish();
      }
    };
    window.addEventListener("MozAfterPaint", verifyL10n);
    document.body.appendChild(elem);
  });
  </script>
</head>
<body>
</body>
</html>