dom/indexedDB/test/unit/test_open_objectStore.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 name = this.window ? window.location.pathname : "Splendid Test";
    11   const objectStoreName = "Objects";
    13   let request = indexedDB.open(name, 1);
    14   request.onerror = errorHandler;
    15   request.onupgradeneeded = grabEventAndContinueHandler;
    16   request.onsuccess = grabEventAndContinueHandler;
    17   let event = yield undefined;
    19   let db = event.target.result;
    20   is(db.objectStoreNames.length, 0, "Bad objectStores list");
    22   let objectStore = db.createObjectStore(objectStoreName,
    23                                          { keyPath: "foo" });
    25   is(db.objectStoreNames.length, 1, "Bad objectStores list");
    26   is(db.objectStoreNames.item(0), objectStoreName, "Bad name");
    28   yield undefined;
    30   objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);
    32   is(objectStore.name, objectStoreName, "Bad name");
    33   is(objectStore.keyPath, "foo", "Bad keyPath");
    34   if(objectStore.indexNames.length, 0, "Bad indexNames");
    36   finishTest();
    37   yield undefined;
    38 }

mercurial