4 <p>This test ensures that a synthetic event dispatched on a plugin doesn't cause a crash.
</p>
5 <embed id=
"plugin" type=
"application/x-webkit-test-webplugin"></embed>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.waitUntilDone();
11 var plugin
= document
.getElementById("plugin");
13 var listenerCalledCount
= 0;
14 var eventTypes
= ["touchmove", "gesturescrollstart", "mousewheel"];
16 eventTypes
.forEach(function(eventType
) {
17 plugin
.addEventListener(eventType
, function(event
) {
18 listenerCalledCount
++;
19 if (listenerCalledCount
== eventTypes
.length
) {
20 if (window
.testRunner
) {
21 testRunner
.notifyDone();
27 var event
= document
.createEvent("PopStateEvent");
28 event
.initEvent("touchmove", true, true);
29 plugin
.dispatchEvent(event
);
31 event
= document
.createEvent("PopStateEvent");
32 event
.initEvent("gesturescrollstart", true, true);
33 plugin
.dispatchEvent(event
);
35 event
= document
.createEvent("PopStateEvent");
36 event
.initEvent("mousewheel", true, true);
37 plugin
.dispatchEvent(event
);