Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
11 request.onerror = errorHandler;
12 request.onupgradeneeded = grabEventAndContinueHandler;
13 let event = yield undefined;
15 let db = event.target.result;
16 db.onerror = errorHandler;
18 event.target.onsuccess = continueToNextStep;
19 db.createObjectStore("foo");
20 yield undefined;
22 let transaction1 = db.transaction("foo");
24 let transaction2;
26 let comp = this.window ? SpecialPowers.wrap(Components) : Components;
27 let thread = comp.classes["@mozilla.org/thread-manager;1"]
28 .getService(comp.interfaces.nsIThreadManager)
29 .currentThread;
31 let eventHasRun;
33 thread.dispatch(function() {
34 eventHasRun = true;
36 transaction2 = db.transaction("foo");
37 }, Components.interfaces.nsIThread.DISPATCH_NORMAL);
39 while (!eventHasRun) {
40 thread.processNextEvent(false);
41 }
43 ok(transaction2, "Non-null transaction2");
45 continueToNextStep();
46 yield undefined;
48 finishTest();
49 yield undefined;
50 }