layout/generic/test/test_bug470212.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 <html>
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=470212
     4 -->
     5 <head>
     6   <title>Test for Bug 470212 -  crash [@ nsContentUtils::ComparePoints]</title>
     7   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     9 </head>
    10 <body>
    11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=470212">Mozilla Bug 470212</a>
    12 <div style="width: 200px;">
    13 <ca>
    14 <canvas style="border: 1px solid black;" id="dragSource"></canvas>
    15 </ca>
    16 </div>
    18 <pre id="test">
    19 <script>
    20 function doShiftDrag(){
    21   setTimeout(function() {
    22     var wu = SpecialPowers.DOMWindowUtils;
    23     var canvas = document.getElementById("dragSource");
    24     var canvasRect = canvas.getBoundingClientRect();
    26     // Drag canvas element starts with a mouse down event, combine with shift
    27     // key, follows by two mouse move events.
    29     // Press on left-top corner of the canvas element.
    30     wu.sendMouseEvent('mousedown',  canvasRect.left, canvasRect.top, 0, 1, 4);
    31     // Move to the center of this cavas element.
    32     wu.sendMouseEvent('mousemove',  canvasRect.left + (canvasRect.width / 2),
    33                       canvasRect.top + (canvasRect.height / 2), 0, 0, 4);
    34     // move out of cavas's region.
    35     wu.sendMouseEvent('mousemove',  canvasRect.left + (canvasRect.width / 2),
    36                       canvasRect.bottom + 10, 0, 0, 4);
    38     is(window.getSelection().rangeCount, 0, "rangeCount should be 0");
    40     wu.sendMouseEvent('mouseup', canvasRect.left + (canvasRect.width / 2),
    41                       canvasRect.bottom + 10, 0, 0, 4);
    43     SimpleTest.finish();
    44   }, 0);
    45 }
    47 SimpleTest.waitForExplicitFinish();
    48 addLoadEvent(doShiftDrag);
    49 </script>
    51 </pre>
    52 </body>
    53 </html>

mercurial