dom/devicestorage/test/test_dotdot.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 <!--
     2   Any copyright is dedicated to the Public Domain.
     3   http://creativecommons.org/publicdomain/zero/1.0/
     4 -->
     5 <!DOCTYPE HTML>
     6 <html> <!--
     7 https://bugzilla.mozilla.org/show_bug.cgi?id=717103
     8 -->
     9 <head>
    10   <title>Test for the device storage API </title>
    11   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    12   <script type="text/javascript" src="devicestorage_common.js"></script>
    14 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    15 </head>
    16 <body>
    17 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717103">Mozilla Bug 717103</a>
    18 <p id="display"></p>
    19 <div id="content" style="display: none">
    21 </div>
    22 <pre id="test">
    23 <script class="testbody" type="text/javascript">
    25 devicestorage_setup();
    27 function testingStorage() {
    28   return navigator.getDeviceStorage("pictures");
    29 }
    31 var tests = [
    32   function () { return testingStorage().addNamed(createRandomBlob('image/png'), gFileName); },
    33   function () { return testingStorage().delete(gFileName); },
    34   function () { return testingStorage().get(gFileName); },
    35   function () { var r = testingStorage().enumerate("../"); return r; }
    36 ];
    38 var gFileName = "../owned.png";
    40 function fail(e) {
    41   ok(false, "addSuccess was called");
    42   dump(request);
    43   devicestorage_cleanup();
    44 }
    46 function next(e) {
    48   if (e != undefined) {
    49     ok(true, "addError was called");  
    50     ok(e.target.error.name == "SecurityError", "Error must be SecurityError");
    51   }
    53   var f = tests.pop();
    55   if (f == undefined) {
    56     devicestorage_cleanup();
    57     return;
    58   }
    60   request = f();
    61   request.onsuccess = fail;
    62   request.onerror = next;
    63 }
    65 next();
    69 </script>
    70 </pre>
    71 </body>
    72 </html>

mercurial