dom/events/test/window_bug659071.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/test/window_bug659071.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Test for Bug 659071</title>
     1.8 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.10 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.11 +</head>
    1.12 +<body>
    1.13 +<video id="v" controls></video>
    1.14 +<script type="application/javascript">
    1.15 +
    1.16 +SimpleTest.waitForFocus(runTests, window);
    1.17 +
    1.18 +function is()
    1.19 +{
    1.20 +  window.opener.is.apply(window.opener, arguments);
    1.21 +}
    1.22 +
    1.23 +function isnot()
    1.24 +{
    1.25 +  window.opener.isnot.apply(window.opener, arguments);
    1.26 +}
    1.27 +
    1.28 +function hitEventLoop(aFunc, aTimes)
    1.29 +{
    1.30 +  if (--aTimes) {
    1.31 +    setTimeout(hitEventLoop, 0, aFunc, aTimes);
    1.32 +  } else {
    1.33 +    setTimeout(aFunc, 20);
    1.34 +  }
    1.35 +}
    1.36 +
    1.37 +function runTests()
    1.38 +{
    1.39 +  SpecialPowers.setIntPref("mousewheel.with_control.action", 3);
    1.40 +  synthesizeKey("0", { accelKey: true });
    1.41 +
    1.42 +  var video = document.getElementById("v");
    1.43 +  hitEventLoop(function () {
    1.44 +    is(SpecialPowers.getFullZoom(window), 1.0,
    1.45 +       "failed to reset zoom");
    1.46 +    synthesizeWheel(video, 10, 10,
    1.47 +      { deltaMode: WheelEvent.DOM_DELTA_LINE, ctrlKey: true,
    1.48 +        deltaX: 0, deltaY: 1.0, lineOrPageDeltaX: 0, lineOrPageDeltaY: 1 });
    1.49 +    hitEventLoop(function () {
    1.50 +      isnot(SpecialPowers.getFullZoom(window), 1.0,
    1.51 +             "failed to zoom by ctrl+wheel");
    1.52 +
    1.53 +      synthesizeKey("0", { accelKey: true });
    1.54 +      SpecialPowers.clearUserPref("mousewheel.with_control.action");
    1.55 +
    1.56 +      hitEventLoop(window.opener.finish, 20);
    1.57 +    }, 20);
    1.58 +  }, 20);
    1.59 +}
    1.60 +
    1.61 +</script>
    1.62 +</body>
    1.63 +</html>
    1.64 \ No newline at end of file

mercurial