js/src/tests/js1_5/extensions/regress-407720.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // |reftest| skip-if(!xulRuntime.shell) 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 = 407720;
     9 var summary = 'js_FindClassObject causes crashes with getter/setter - Browser only';
    10 var actual = 'No Crash';
    11 var expect = 'No Crash';
    13 printBugNumber(BUGNUMBER);
    14 printStatus (summary);
    16 // stop the test after 60 seconds
    17 var start = new Date();
    19 if (typeof document != 'undefined')
    20 { 
    21   // delay test driver end
    22   gDelayTestDriverEnd = true;
    23   document.write('<iframe onload="onLoad()"><\/iframe>');
    24 }
    25 else
    26 {
    27   actual = 'No Crash';
    28   reportCompare(expect, actual, summary);
    29 }
    31 function onLoad() 
    32 {
    34   if ( (new Date() - start) < 60*1000)
    35   {
    36     var x = frames[0].Window.prototype;
    37     x.a = x.b = x.c = 1;
    38     x.__defineGetter__("HTML document.all class", function() {});
    39     frames[0].document.all;
    41     // retry
    42     frames[0].location = "about:blank";
    43   }
    44   else
    45   {
    46     actual = 'No Crash';
    48     reportCompare(expect, actual, summary);
    49     gDelayTestDriverEnd = false;
    50     jsTestDriverEnd();
    51   }
    52 }

mercurial