js/xpconnect/tests/mochitest/test_bug829872.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=829872
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 829872</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   <script type="application/javascript">
    13   /** Test for Bug 829872 and Bug 968003 **/
    14   SimpleTest.waitForExplicitFinish();
    16   var gLoadCount = 0;
    17   function loaded() {
    18     if (++gLoadCount == 3)
    19       go();
    20   }
    22   function check(elem, desc) {
    23     is(elem.contentDocument, null, "null cross-origin contentDocument for " + desc);
    24     ok(SpecialPowers.wrap(elem).contentWindow.eval('frameElement === null;'),
    25        "null cross-origin frameElement for " + desc);
    26     if (!(elem instanceof HTMLFrameElement))
    27       is(elem.getSVGDocument(), null, "null cross-origin getSVGDocument() for " + desc);
    28   }
    30   function go() {
    31     ok(true, "Starting test");
    32     check($('ifr'), "iframe element");
    33     check($('obj'), "object element");
    34     check($('framesetholder').contentDocument.getElementById('fr'), "frameset frame");
    35     SimpleTest.finish();
    36   }
    38   </script>
    39 </head>
    40 <body>
    41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Mozilla Bug 829872</a>
    42 <p id="display"></p>
    43 <div id="content" style="display: none">
    45 </div>
    46 <pre id="test">
    47 </pre>
    48 <iframe id="ifr" onload="loaded();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
    49 <object id="obj" onload="loaded();" data="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></object>
    50 <iframe id="framesetholder" src="data:text/html,<html><head></head><frameset cols='100%'><frame id='fr' onload='parent.loaded();' src='http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html' /></frameset></html>"></iframe>
    51 </body>
    52 </html>

mercurial