dom/devicestorage/test/test_sanity.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 <!--
     8 https://bugzilla.mozilla.org/show_bug.cgi?id=717103
     9 -->
    10 <head>
    11   <title>Test for basic sanity of the device storage API </title>
    12   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    13   <script type="text/javascript" src="devicestorage_common.js"></script>
    15 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    16 </head>
    17 <body>
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717103">Mozilla Bug 717103</a>
    19 <p id="display"></p>
    20 <div id="content" style="display: none">
    22 </div>
    23 <pre id="test">
    24 <script class="testbody" type="text/javascript">
    26 devicestorage_setup()
    28 ok(navigator.getDeviceStorage, "Should have getDeviceStorage");
    30 var storage;
    32 var throws = false;
    33 try {
    34  storage = navigator.getDeviceStorage();
    35 } catch(e) {throws = true}
    36 ok(throws, "getDeviceStorage takes one arg");
    38 storage = navigator.getDeviceStorage("kilimanjaro");
    39 ok(!storage, "kilimanjaro - Should not have this type of storage");
    41 storage = navigator.getDeviceStorage("pictures");
    42 ok(storage, "pictures - Should have getDeviceStorage");
    44 storage = navigator.getDeviceStorage("music");
    45 ok(storage, "music - Should have getDeviceStorage");
    47 storage = navigator.getDeviceStorage("videos");
    48 ok(storage, "videos - Should have getDeviceStorage");
    50 var cursor = storage.enumerate();
    51 ok(cursor, "Should have a non-null cursor");
    53 devicestorage_cleanup();
    55 </script>
    56 </pre>
    57 </body>
    58 </html>

mercurial