1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_5/Regress/regress-341360.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow 1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +//----------------------------------------------------------------------------- 1.11 +var BUGNUMBER = 341360; 1.12 +var summary = 'clearInterval broken'; 1.13 +var actual = ''; 1.14 +var expect = 'Ok'; 1.15 + 1.16 +printBugNumber(BUGNUMBER); 1.17 +printStatus (summary); 1.18 + 1.19 +function xxx() 1.20 +{ 1.21 + if(t != null) 1.22 + { 1.23 + print('Clearing interval...'); 1.24 + window.clearInterval(t); 1.25 + t = null; 1.26 + setTimeout('yyy()', 2000); 1.27 + 1.28 + } 1.29 + else { 1.30 + print('Clearing interval failed...'); 1.31 + actual = "Broken"; 1.32 + gDelayTestDriverEnd = false; 1.33 + reportCompare(expect, actual, summary); 1.34 + jsTestDriverEnd(); 1.35 + } 1.36 +} 1.37 + 1.38 +function yyy() 1.39 +{ 1.40 + print('Checking result...'); 1.41 + actual = 'Ok'; 1.42 + gDelayTestDriverEnd = false; 1.43 + reportCompare(expect, actual, summary); 1.44 + jsTestDriverEnd(); 1.45 +} 1.46 + 1.47 +if (typeof window == 'undefined') 1.48 +{ 1.49 + expect = actual = 'Not tested'; 1.50 + reportCompare(expect, actual, summary); 1.51 +} 1.52 +else 1.53 +{ 1.54 + print('Start...'); 1.55 + gDelayTestDriverEnd = true; 1.56 + var t = window.setInterval(xxx, 1000); 1.57 +} 1.58 +