dom/indexedDB/test/unit/test_request_readyState.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";
    12   let request = indexedDB.open(name, 1);
    13   is(request.readyState, "pending", "Correct readyState");
    15   request.onerror = errorHandler;
    16   request.onupgradeneeded = grabEventAndContinueHandler;
    17   let event = yield undefined;
    19   is(request.readyState, "done", "Correct readyState");
    21   let db = event.target.result;
    23   let objectStore = db.createObjectStore("foo");
    24   let key = 10;
    26   request = objectStore.add({}, key);
    27   is(request.readyState, "pending", "Correct readyState");
    29   request.onerror = errorHandler;
    30   request.onsuccess = grabEventAndContinueHandler;
    31   event = yield undefined;
    33   is(request.readyState, "done", "Correct readyState");
    34   is(event.target.result, key, "Correct key");
    36   request = objectStore.get(key);
    37   request.onerror = errorHandler;
    38   request.onsuccess = grabEventAndContinueHandler;
    39   is(request.readyState, "pending", "Correct readyState");
    40   event = yield undefined;
    42   ok(event.target.result, "Got something");
    43   is(request.readyState, "done", "Correct readyState");
    45   finishTest();
    46   yield undefined;
    47 }

mercurial