1 <p>This page tests various event attributes after dispatchEvent throws an exception.</p>
2 <p>If the test passes, you'll see a series of PASS messages below.</p>
4 <pre id="console"></pre>
7 if (window.layoutTestController)
8 layoutTestController.dumpAsText();
12 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
15 function shouldBe(aDescription, a, b)
18 log("PASS: " + aDescription + " should be " + b + " and is.");
21 log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".");
24 window.onload = function()
26 var event = document.createEvent("MouseEvent");
28 document.getElementById("console").dispatchEvent(event);
31 shouldBe("event.target", event.target, null);
32 shouldBe("event.currentTarget", event.currentTarget, null);
33 shouldBe("event.relatedTarget", event.relatedTarget, null);
34 shouldBe("event.eventPhase", event.eventPhase, 0);