summaryrefslogtreecommitdiffstats
path: root/dom/l10n/tests/mochitest/l10n_mutations/test_append_content_pre_dcl.html
blob: 825464e7b830027128a973b50ca908a0eb93c5eb (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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test L10n Mutations for ContentAppended before 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"/>
</head>
<body>
  <script type="application/javascript">
  "use strict";
  SimpleTest.waitForExplicitFinish();

  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>
</body>
</html>