Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / dispatchEvent-crash.html
blob33765e82514f1910117c1bd7a23ffdd5984f4c57
1 <p>This is a test for https://bugs.webkit.org/show_bug.cgi?id=21063 (NULL pointer crash in dispatchEvent(null)). It passes if it does not crash.</p>
2 <script>
3 if (window.testRunner)
4 testRunner.dumpAsText();
6 // FIXME: this should also test WorkerContext and MessagePort.
7 var eventTargets = [new XMLHttpRequest, (new XMLHttpRequest).upload, window.applicationCache, new Worker("about:blank"), document.body];
9 for (var i = 0; i < eventTargets.length; ++i) {
10 eventTarget = eventTargets[i];
11 try {
12 eventTarget.dispatchEvent(null);
13 } catch(e) {
16 try {
17 eventTarget.dispatchEvent(undefined);
18 } catch(e) {
21 try {
22 eventTarget.dispatchEvent("string");
23 } catch(e) {
26 try {
27 eventTarget.dispatchEvent(0);
28 } catch(e) {
31 try {
32 eventTarget.dispatchEvent({});
33 } catch(e) {
36 </script>