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.

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

mercurial