[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / dispatch-to-handle-event.html
1 <html>
2 <head>
3 <script>
4
5 var handler = new Object;
6 handler.handleEvent = function (event) {
7     document.getElementById("console").appendChild(document.createTextNode("Received event: " + event));
8 }
9
10 function test() {
11     if (window.layoutTestController)
12         layoutTestController.dumpAsText();
13
14     document.addEventListener("event", handler, false);
15     var event = document.createEvent("Event");
16     event.initEvent("event", true, true);
17     document.dispatchEvent(event);
18 }
19
20 </script>
21
22 <body onload="test()">
23 <p>This test creates and sends an event to a handler that's implemented with a handleEvent function.
24 If the test succeeds, there will be text below saying "Received event".</p>
25 <div id="console"></div>
26 </body>
27 </html>