Change fast/e* files to use pre and post js files in LayoutTests/resources.
[WebKit-https.git] / LayoutTests / fast / events / mouseover-button.html
1 <html>
2     <head>
3         <script src="../../resources/js-test-pre.js"></script>
4     </head>
5
6 <body>
7 <p>Test for bugs 
8 <a href="http://code.google.com/p/chromium/issues/detail?id=87473">cr 87473</a>, <a href="https://bugs.webkit.org/show_bug.cgi?id=64882">64882</a>.
9
10 <p id="description"></p>
11 <iframe style='height: 50; width: 50; top:100;left:100; position:absolute; border-width:0' src='resources/mouseover-button-iframe.html'
12     ></iframe>
13 <div id="console"></div>
14
15 <script>
16
17 document.events = {};
18 document.saveWhere = null;
19
20 function runTest() {
21     if (window.testRunner) {
22         testRunner.dumpAsText();
23         testRunner.waitUntilDone();
24
25         eventSender.mouseMoveTo(1,1);
26         eventSender.mouseDown();
27         eventSender.mouseUp();
28
29         state('A-no-press');
30         
31         eventSender.mouseMoveTo(125, 125);
32
33         state('B-left');
34         eventSender.mouseDown(0);
35         eventSender.mouseMoveTo(300, 300);
36
37         eventSender.mouseMoveTo(125, 125);
38
39         eventSender.mouseMoveTo(1, 1);
40         eventSender.mouseUp();
41
42         state('C-no-press');
43         eventSender.mouseMoveTo(125, 125);
44
45         state('D-middle');
46         eventSender.mouseDown(1);
47         eventSender.mouseMoveTo(300, 300);
48         eventSender.mouseMoveTo(125, 125);
49
50         eventSender.mouseUp(1);
51
52         eventSender.mouseMoveTo(1, 1);
53
54         window.setTimeout('finish()', 0);
55     }
56 }
57
58 function state(name)
59 {
60     document.saveWhere = name;
61     document.events[name] = null;
62 }
63
64 function finish()
65 {
66     shouldBe("document.events['A-no-press'].which", "0");
67     shouldBe("document.events['B-left'].which", "1");
68     shouldBe("document.events['C-no-press'].which", "0");
69     shouldBe("document.events['D-middle'].which", "2");
70
71     testRunner.notifyDone()
72 }
73
74 description("This test verifies that we get the correct button on mouseover events in .which when entering a document.");
75
76 window.onload = function()
77 {
78     recentEvent = null;
79     runTest();
80 }
81
82 </script>
83
84 </body>
85 </html>