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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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