gecko-dev/dom/events/test/test_bug1518442.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 строки
1.4 KiB
HTML
Исходник Обычный вид История

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test for Bug 1518442</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
function runTest() {
try {
let eventName = "formdata";
window.testValue = "not fired";
document.documentElement.setAttribute("on" + eventName, "window.testValue = 'fired'");
document.documentElement.dispatchEvent(new Event(eventName));
is(window.testValue, "not fired", `${eventName} should not have fired when pref disable`);
window.testValue = "not fired";
document.documentElement.removeAttribute("on" + eventName);
document.documentElement.dispatchEvent(new Event(eventName));
is(window.testValue, "not fired", `${eventName} should not have fired any event`);
is(window.onformdata, null, "Should not have window.onformdata");
is(document.onformdata, null, "Should not have document.onformdata");
is(document.documentElement.onformdata, null, "Should not have document.documentElement.onformdata");
} finally {
delete window.testValue;
SimpleTest.finish();
}
};
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["dom.formdata.event.enabled", false]]}, runTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>
</body>
</html>