Bug 1676520 - Stop using aboutConfig.ftl in test_set_attributes.html. r=zbraniecki

Differential Revision: https://phabricator.services.mozilla.com/D96671
This commit is contained in:
Tim Nguyen 2020-11-11 08:15:18 +00:00
parent 50215d649d
commit e74467b1d6

View File

@ -6,7 +6,7 @@
<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"/>
<link rel="localization" href="toolkit/about/aboutConfig.ftl"/>
<link rel="localization" href="toolkit/about/aboutCompat.ftl"/>
<script type="application/javascript">
"use strict";
SimpleTest.waitForExplicitFinish();
@ -16,12 +16,12 @@
let elem = document.getElementById("elem1");
let elem2 = document.getElementById("elem2");
is(elem.textContent.length, 0);
is(elem2.textContent.includes("Type 1"), true);
is(elem2.textContent.includes("Initial string"), true);
document.l10n.setAttributes(elem, "crash-reports-title");
elem2.setAttribute("data-l10n-args", JSON.stringify({type: "Type 2"}));
elem2.setAttribute("data-l10n-args", JSON.stringify({bug: "New string"}));
let verifyL10n = () => {
if (elem.textContent.length > 0 && elem2.textContent.includes("Type 2")) {
if (elem.textContent.length > 0 && elem2.textContent.includes("New string")) {
window.removeEventListener("MozAfterPaint", verifyL10n);
SimpleTest.finish();
}
@ -32,6 +32,6 @@
</head>
<body>
<div id="elem1"></div>
<div id="elem2" data-l10n-id="config-new-title" data-l10n-args='{"type":"Type 1"}'></div>
<div id="elem2" data-l10n-id="label-more-information" data-l10n-args='{"bug":"Initial string"}'></div>
</body>
</html>