js/src/tests/js1_5/Regress/regress-246964.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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 246964;
     8 // see also bug 248549, bug 253150, bug 259935
     9 var summary = 'undetectable document.all';
    10 var actual = '';
    11 var expect = '';
    13 printBugNumber(BUGNUMBER);
    14 printStatus (summary);
    16 if (typeof document == 'undefined')
    17 {
    18   expect = actual = 'Test requires browser: skipped';
    19   reportCompare(expect, actual, summary);
    20 }
    21 else
    22 {
    23   status = summary + ' ' + inSection(1) + ' if (document.all) ';
    24   expect = false;
    25   actual = false;
    26   if (document.all)
    27   {
    28     actual = true;
    29   }
    30   reportCompare(expect, actual, status);
    32   status = summary + ' ' + inSection(2) + 'if (isIE) ';
    33   expect = false;
    34   actual = false;
    35   var isIE = document.all;
    36   if (isIE)
    37   {
    38     actual = true;
    39   }
    40   reportCompare(expect, actual, status);
    42   status = summary + ' ' + inSection(3) + ' if (document.all != undefined) ';
    43   expect = false;
    44   actual = false;
    45   if (document.all != undefined)
    46   {
    47     actual = true;
    48   }
    49   reportCompare(expect, actual, status);
    52   status = summary + ' ' + inSection(4) + ' if (document.all !== undefined) ';
    53   expect = true;
    54   actual = false;
    55   if (document.all !== undefined)
    56   {
    57     actual = true;
    58   }
    59   reportCompare(expect, actual, status);
    61   status = summary + ' ' + inSection(5) + ' if (document.all != null) ' ;
    62   expect = false;
    63   actual = false;
    64   if (document.all != null)
    65   {
    66     actual = true;
    67   }
    68   reportCompare(expect, actual, status);
    70   status = summary + ' ' + inSection(6) + ' if (document.all !== null) ' ;
    71   expect = true;
    72   actual = false;
    73   if (document.all !== null)
    74   {
    75     actual = true;
    76   }
    77   reportCompare(expect, actual, status);
    79   status = summary + ' ' + inSection(7) + ' if (document.all == null) ';
    80   expect = true;
    81   actual = false;
    82   if (document.all == null)
    83   {
    84     actual = true;
    85   }
    86   reportCompare(expect, actual, status);
    88   status = summary + ' ' + inSection(8) + ' if (document.all === null) ';
    89   expect = false;
    90   actual = false;
    91   if (document.all === null)
    92   {
    93     actual = true;
    94   }
    95   reportCompare(expect, actual, status);
    97   status = summary + ' ' + inSection(9) + ' if (document.all == undefined) ';
    98   expect = true;
    99   actual = false;
   100   if (document.all == undefined)
   101   {
   102     actual = true;
   103   }
   104   reportCompare(expect, actual, status);
   106   status = summary + ' ' + inSection(10) + ' if (document.all === undefined) ';
   107   expect = false;
   108   actual = false;
   109   if (document.all === undefined)
   110   {
   111     actual = true;
   112   }
   113   reportCompare(expect, actual, status);
   115   status = summary + ' ' + inSection(11) +
   116     ' if (typeof document.all == "undefined") ';
   117   expect = true;
   118   actual = false;
   119   if (typeof document.all == 'undefined')
   120   {
   121     actual = true;
   122   }
   123   reportCompare(expect, actual, status);
   125   status = summary + ' ' + inSection(12) +
   126     ' if (typeof document.all != "undefined") ';
   127   expect = false;
   128   actual = false;
   129   if (typeof document.all != 'undefined')
   130   {
   131     actual = true;
   132   }
   133   reportCompare(expect, actual, status);
   135   status = summary + ' ' + inSection(13) + ' if ("all" in document) ';
   136   expect = (document.compatMode == 'CSS1Compat') ? false : true;
   137   actual = false;
   138   if ('all' in document)
   139   {
   140     actual = true;
   141   }
   142   reportCompare(expect, actual, status);
   144   status = summary + ' ' + inSection(14) + ' if (f.ie) ';
   145   var f = new foo();
   147   expect = false;
   148   actual = false;
   149   if (f.ie)
   150   {
   151     actual = true;
   152   }
   153   reportCompare(expect, actual, status);
   155 }
   157 function foo()
   158 {
   159   this.ie = document.all;
   160 }

mercurial