dom/indexedDB/test/unit/test_open_empty_db.js

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 var testGenerator = testSteps();
     8 function testSteps()
     9 {
    10   const names = [
    11     //"",
    12     null,
    13     undefined,
    14     this.window ? window.location.pathname : "Splendid Test"
    15   ];
    17   const version = 1;
    19   for each (let name in names) {
    20     let request = indexedDB.open(name, version);
    21     request.onerror = errorHandler;
    22     request.onsuccess = grabEventAndContinueHandler;
    23     let event = yield undefined;
    25     if (name === null) {
    26       name = "null";
    27     }
    28     else if (name === undefined) {
    29       name = "undefined";
    30     }
    32     let db = event.target.result;
    33     is(db.name, name, "Bad name");
    34     is(db.version, version, "Bad version");
    35     is(db.objectStoreNames.length, 0, "Bad objectStores list");
    37     is(db.name, request.result.name, "Bad name");
    38     is(db.version, request.result.version, "Bad version");
    39     is(db.objectStoreNames.length, request.result.objectStoreNames.length,
    40        "Bad objectStores list");
    41   }
    43   finishTest();
    44   yield undefined;
    45 }

mercurial