dom/indexedDB/test/unit/GlobalObjectsModule.jsm

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  */
     6 Components.utils.importGlobalProperties(["indexedDB"]);
     8 this.EXPORTED_SYMBOLS = [
     9   "GlobalObjectsModule"
    10 ];
    12 this.GlobalObjectsModule = function GlobalObjectsModule() {
    13 }
    15 GlobalObjectsModule.prototype = {
    16   runTest: function() {
    17     const name = "Splendid Test";
    19     let ok = this.ok;
    20     let finishTest = this.finishTest;
    22     let keyRange = IDBKeyRange.only(42);
    23     ok(keyRange, "Got keyRange");
    25     let request = indexedDB.open(name, 1);
    26     request.onerror = function(event) {
    27       ok(false, "indexedDB error, '" + event.target.error.name + "'");
    28       finishTest();
    29     }
    30     request.onsuccess = function(event) {
    31       let db = event.target.result;
    32       ok(db, "Got database");
    33       finishTest();
    34     }
    35   }
    36 }

mercurial