content/html/document/test/test_bug259332.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 <html>
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=259332
     4 -->
     5 <head>
     6   <title>Test for Bug 259332</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     9 </head>
    10 <body>
    11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=259332">Mozilla Bug 259332</a>
    12 <p id="display"></p>
    13 <div id="content">
    14   <div id="a">a
    15     <div id="a">a</div>
    16     <input name="a" value="a">
    17     <div id="b">b</div>
    18     <input name="b" value="b">
    19     <div id="c">c</div>
    20   </div>
    21   <input name="write">
    22   <input name="write">
    23   <input id="write">
    24 </div>
    25 <pre id="test">
    26 <script class="testbody" type="text/javascript">
    28 /** Test for Bug 259332 **/
    30 list = document.all.a;
    31 ok(list.length == 3, "initial a length");
    33 blist = document.all.b;
    34 ok(document.all.b.length == 2, "initial b length");
    35 document.getElementById('b').id = 'a';
    36 ok(document.all.b.nodeName == "INPUT", "just one b");
    38 ok(blist.length == 1, "just one b");
    39 ok(list.length == 4, "one more a");
    41 newDiv = document.createElement('div');
    42 newDiv.id = 'a';
    43 newDiv.innerHTML = 'a';
    44 list[0].appendChild(newDiv);
    45 ok(list.length == 5, "two more a");
    47 ok(document.all.c.textContent == 'c', "one c");
    48 document.all.c.id = 'a';
    49 ok(!document.all.c, "no c");
    50 ok(list.length == 6, "three more a");
    52 ok(document.all.write.length == 3, "name is write");
    54 newDiv = document.createElement('div');
    55 newDiv.id = 'd';
    56 newDiv.innerHTML = 'd';
    57 list[0].appendChild(newDiv);
    58 ok(document.all.d.textContent == 'd', "new d");
    61 </script>
    62 </pre>
    63 </body>
    64 </html>

mercurial