add_task(async function () {
await pushPref(THEME_PREF, "light");
await pushPref("devtools.high-contrast-mode-support", true); // force HCM
await pushPref("browser.display.document_color_use", 2);
await pushPref("ui.useAccessibilityTheme", 1);
// For some reason, mochitest spawn a very special default tab, // whose WindowGlobal is still the initial about:blank document. // This seems to be specific to mochitest, this doesn't reproduce // in regular firefox run. Even having about:blank as home page, // force loading another final about:blank document (which isn't the initial one) // // To workaround this, force opening a dedicated test tab const tab = await addTab("data:text/html;charset=utf-8,Test page");
is(
root.hasAttribute("forced-colors-active"),
forcedColorsActive,
`high contrast mode is ${
!forcedColorsActive ? "not " : ""
}supported in ${themePrefValue} theme`
);
const sheetsInDOM = Array.from(
root.ownerDocument.querySelectorAll("link[rel='stylesheet']"),
l => l.href
);
const sheetsFromTheme = gDevTools.getThemeDefinition(theme).stylesheets;
info("Checking for existence of " + sheetsInDOM.length + " sheets"); for (const themeSheet of sheetsFromTheme) {
ok(
sheetsInDOM.some(s => s.includes(themeSheet)), "There is a stylesheet for " + themeSheet
);
}
}
function getPlatform() { const { OS } = Services.appinfo; if (OS == "WINNT") { return"win";
} elseif (OS == "Darwin") { return"mac";
} return"linux";
}
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.