dom/events/test/window_bug659071.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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">
    13 SimpleTest.waitForFocus(runTests, window);
    15 function is()
    16 {
    17   window.opener.is.apply(window.opener, arguments);
    18 }
    20 function isnot()
    21 {
    22   window.opener.isnot.apply(window.opener, arguments);
    23 }
    25 function hitEventLoop(aFunc, aTimes)
    26 {
    27   if (--aTimes) {
    28     setTimeout(hitEventLoop, 0, aFunc, aTimes);
    29   } else {
    30     setTimeout(aFunc, 20);
    31   }
    32 }
    34 function runTests()
    35 {
    36   SpecialPowers.setIntPref("mousewheel.with_control.action", 3);
    37   synthesizeKey("0", { accelKey: true });
    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");
    50       synthesizeKey("0", { accelKey: true });
    51       SpecialPowers.clearUserPref("mousewheel.with_control.action");
    53       hitEventLoop(window.opener.finish, 20);
    54     }, 20);
    55   }, 20);
    56 }
    58 </script>
    59 </body>
    60 </html>

mercurial