dom/indexedDB/test/unit/test_event_source.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   var request = indexedDB.open(name, 1);
    14   request.onerror = errorHandler;
    15   request.onupgradeneeded = grabEventAndContinueHandler;
    16   var event = yield undefined;
    18   is(event.target.source, null, "correct event.target.source");
    20   var db = event.target.result;
    21   var objectStore = db.createObjectStore(objectStoreName,
    22                                          { autoIncrement: true });
    23   request = objectStore.add({});
    24   request.onerror = errorHandler;
    25   request.onsuccess = grabEventAndContinueHandler;
    26   event = yield undefined;
    28   ok(event.target.source === objectStore, "correct event.source");
    30   finishTest();
    31   yield undefined;
    32 }

mercurial