content/base/test/test_bug719533.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 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=719544
     4 -->
     5 <title>Test for Bug 719544</title>
     6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
     7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
     8 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=719544">Mozilla Bug 719544</a>
     9 <script>
    11 /** Test for Bug 719544 **/
    12 var threw = false;
    13 var origLength = document.childNodes.length;
    14 try {
    15   var range = document.createRange();
    16   range.selectNodeContents(document);
    17   range.extractContents();
    18 } catch(e) {
    19   threw = true;
    20   is(Object.getPrototypeOf(e), DOMException.prototype,
    21      "Must throw DOMException");
    22   is(e.name, "HierarchyRequestError", "Must throw HierarchyRequestError");
    23 }
    24 ok(threw, "Must throw");
    25 is(document.childNodes.length, origLength, "Must preserve original children");
    27 </script>

mercurial