dom/base/test/test_window_extensible.html

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 <!DOCTYPE html>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=856384
     5 -->
     6 <head>
     7   <meta charset="UTF-8">
     8   <title>Test for Bug 856384</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=856384">Mozilla Bug 856384</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    16 </div>
    17 <iframe name="constructor" src="about:blank"></iframe>
    18 <pre id="test">
    19 <script type="application/javascript">
    20 SimpleTest.waitForExplicitFinish();
    22 function run()
    23 {
    24   is(Object.isExtensible(window), true, "Windows are extensible by default");
    26   try
    27   {
    28     Object.preventExtensions(window);
    29     throw "didn't throw";
    30   }
    31   catch (e)
    32   {
    33     is(e instanceof TypeError, true,
    34        "preventExtensions(window) should throw a TypeError, instead got: " + e);
    35     is(Object.isExtensible(window), true,
    36        'Windows are extensible after an extensibility "change" attempt');
    37   }
    39   SimpleTest.finish();
    40 }
    42 window.addEventListener("load", run, false);
    43 </script>
    44 </pre>
    45 </body>
    46 </html>

mercurial