1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_5/extensions/regress-407720.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +// |reftest| skip-if(!xulRuntime.shell) 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 = 407720; 1.12 +var summary = 'js_FindClassObject causes crashes with getter/setter - Browser only'; 1.13 +var actual = 'No Crash'; 1.14 +var expect = 'No Crash'; 1.15 + 1.16 +printBugNumber(BUGNUMBER); 1.17 +printStatus (summary); 1.18 + 1.19 +// stop the test after 60 seconds 1.20 +var start = new Date(); 1.21 + 1.22 +if (typeof document != 'undefined') 1.23 +{ 1.24 + // delay test driver end 1.25 + gDelayTestDriverEnd = true; 1.26 + document.write('<iframe onload="onLoad()"><\/iframe>'); 1.27 +} 1.28 +else 1.29 +{ 1.30 + actual = 'No Crash'; 1.31 + reportCompare(expect, actual, summary); 1.32 +} 1.33 + 1.34 +function onLoad() 1.35 +{ 1.36 + 1.37 + if ( (new Date() - start) < 60*1000) 1.38 + { 1.39 + var x = frames[0].Window.prototype; 1.40 + x.a = x.b = x.c = 1; 1.41 + x.__defineGetter__("HTML document.all class", function() {}); 1.42 + frames[0].document.all; 1.43 + 1.44 + // retry 1.45 + frames[0].location = "about:blank"; 1.46 + } 1.47 + else 1.48 + { 1.49 + actual = 'No Crash'; 1.50 + 1.51 + reportCompare(expect, actual, summary); 1.52 + gDelayTestDriverEnd = false; 1.53 + jsTestDriverEnd(); 1.54 + } 1.55 +}