|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test for Bug 659071</title> |
|
5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 </head> |
|
9 <body> |
|
10 <video id="v" controls></video> |
|
11 <script type="application/javascript"> |
|
12 |
|
13 SimpleTest.waitForFocus(runTests, window); |
|
14 |
|
15 function is() |
|
16 { |
|
17 window.opener.is.apply(window.opener, arguments); |
|
18 } |
|
19 |
|
20 function isnot() |
|
21 { |
|
22 window.opener.isnot.apply(window.opener, arguments); |
|
23 } |
|
24 |
|
25 function hitEventLoop(aFunc, aTimes) |
|
26 { |
|
27 if (--aTimes) { |
|
28 setTimeout(hitEventLoop, 0, aFunc, aTimes); |
|
29 } else { |
|
30 setTimeout(aFunc, 20); |
|
31 } |
|
32 } |
|
33 |
|
34 function runTests() |
|
35 { |
|
36 SpecialPowers.setIntPref("mousewheel.with_control.action", 3); |
|
37 synthesizeKey("0", { accelKey: true }); |
|
38 |
|
39 var video = document.getElementById("v"); |
|
40 hitEventLoop(function () { |
|
41 is(SpecialPowers.getFullZoom(window), 1.0, |
|
42 "failed to reset zoom"); |
|
43 synthesizeWheel(video, 10, 10, |
|
44 { deltaMode: WheelEvent.DOM_DELTA_LINE, ctrlKey: true, |
|
45 deltaX: 0, deltaY: 1.0, lineOrPageDeltaX: 0, lineOrPageDeltaY: 1 }); |
|
46 hitEventLoop(function () { |
|
47 isnot(SpecialPowers.getFullZoom(window), 1.0, |
|
48 "failed to zoom by ctrl+wheel"); |
|
49 |
|
50 synthesizeKey("0", { accelKey: true }); |
|
51 SpecialPowers.clearUserPref("mousewheel.with_control.action"); |
|
52 |
|
53 hitEventLoop(window.opener.finish, 20); |
|
54 }, 20); |
|
55 }, 20); |
|
56 } |
|
57 |
|
58 </script> |
|
59 </body> |
|
60 </html> |