Change fast/e* files to use pre and post js files in LayoutTests/resources.
[WebKit-https.git] / LayoutTests / fast / events / dispatch-synthetic-mouseevent.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id='top'>
9 </div>
10 <pre id="console"></pre>
11 <script>
12 description("Tests to ensure that dblclick event is not fired.");
13
14 function clickHandler(event)
15 {
16     debug('click event is fired.');
17 }
18
19 function dblclickHandler(event)
20 {
21     testFailed('dblclick event should not be fired.');
22 }
23
24 function test()
25 {
26     if (window.testRunner)
27         testRunner.dumpAsText();
28
29     var node = document.getElementById('top');
30     node.addEventListener('click', clickHandler, false);
31     node.addEventListener('dblclick', dblclickHandler, false);
32
33     var event = document.createEvent("MouseEvents");
34     var details = 2;
35     event.initMouseEvent("click", true, false, window,
36                          details, 10, 10, 10, 10, false, false, false, false, 0, null);
37     node.dispatchEvent(event);
38 }
39
40 test();
41 </script>
42 <script src="../../resources/js-test-post.js"></script>
43 </body>
44 </html>