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