js/src/tests/js1_5/Regress/regress-127243.js

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 // |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 //-----------------------------------------------------------------------------
     8 var BUGNUMBER = 127243;
     9 var summary = 'Do not crash on watch';
    10 var actual = 'No Crash';
    11 var expect = 'No Crash';
    13 printBugNumber(BUGNUMBER);
    14 printStatus (summary);
    16 if (typeof window != 'undefined' && typeof document != 'undefined') 
    17 {
    18   // delay test driver end
    19   gDelayTestDriverEnd = true;
    20   window.addEventListener('load', handleLoad, false);
    21 }
    22 else
    23 {
    24   printStatus('This test must be run in the browser');
    25   reportCompare(expect, actual, summary);
    27 }
    29 var div;
    31 function handleLoad()
    32 {
    33   div = document.createElement('div');
    34   document.body.appendChild(div);
    35   div.setAttribute('id', 'id1');
    36   div.style.width = '50px';
    37   div.style.height = '100px';
    38   div.style.overflow = 'auto';
    40   for (var i = 0; i < 5; i++)
    41   {
    42     var p = document.createElement('p');
    43     var t = document.createTextNode('blah');
    44     p.appendChild(t);
    45     div.appendChild(p);
    46   }
    48   div.watch('scrollTop', wee);
    50   setTimeout('setScrollTop()', 1000);
    51 }
    53 function wee(id, oldval, newval)
    54 {
    55   var t = document.createTextNode('setting ' + id +
    56                                   ' value ' + div.scrollTop +
    57                                   ' oldval ' + oldval +
    58                                   ' newval ' + newval);
    59   var p = document.createElement('p');
    60   p.appendChild(t);
    61   document.body.appendChild(p);
    63   return newval;
    64 }
    66 function setScrollTop()
    67 {
    68   div.scrollTop = 42;
    70   reportCompare(expect, actual, summary);
    72   gDelayTestDriverEnd = false;
    73   jsTestDriverEnd();
    75 }

mercurial