2012-08-13 07:20:13 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 659071</title>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<video id="v" controls></video>
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
SimpleTest.waitForFocus(runTests, window);
|
|
|
|
|
|
|
|
function is()
|
|
|
|
{
|
|
|
|
window.opener.is.apply(window.opener, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
function isnot()
|
|
|
|
{
|
|
|
|
window.opener.isnot.apply(window.opener, arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
function hitEventLoop(aFunc, aTimes)
|
|
|
|
{
|
|
|
|
if (--aTimes) {
|
|
|
|
setTimeout(hitEventLoop, 0, aFunc, aTimes);
|
|
|
|
} else {
|
|
|
|
setTimeout(aFunc, 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function runTests()
|
|
|
|
{
|
|
|
|
SpecialPowers.setIntPref("mousewheel.with_control.action", 3);
|
2012-08-15 08:51:13 -07:00
|
|
|
synthesizeKey("0", { accelKey: true });
|
2012-08-13 07:20:13 -07:00
|
|
|
|
|
|
|
var video = document.getElementById("v");
|
|
|
|
hitEventLoop(function () {
|
|
|
|
is(SpecialPowers.getFullZoom(window), 1.0,
|
|
|
|
"failed to reset zoom");
|
|
|
|
synthesizeWheel(video, 10, 10,
|
|
|
|
{ deltaMode: WheelEvent.DOM_DELTA_LINE, ctrlKey: true,
|
|
|
|
deltaX: 0, deltaY: 1.0, lineOrPageDeltaX: 0, lineOrPageDeltaY: 1 });
|
|
|
|
hitEventLoop(function () {
|
|
|
|
isnot(SpecialPowers.getFullZoom(window), 1.0,
|
|
|
|
"failed to zoom by ctrl+wheel");
|
|
|
|
|
2012-08-15 08:51:13 -07:00
|
|
|
synthesizeKey("0", { accelKey: true });
|
2012-08-13 07:20:13 -07:00
|
|
|
SpecialPowers.clearUserPref("mousewheel.with_control.action");
|
|
|
|
|
|
|
|
hitEventLoop(window.opener.finish, 20);
|
|
|
|
}, 20);
|
|
|
|
}, 20);
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|