2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
6 /* exported testGenerator, disableWorkerTest */
7 var disableWorkerTest = "Need a way to set temporary prefs from a worker";
9 var testGenerator = testSteps();
11 function* testSteps() {
12 const name = this.window
13 ? window.location.pathname
14 : "test_readwriteflush_disabled.js";
16 info("Resetting experimental pref");
19 SpecialPowers.pushPrefEnv(
21 set: [["dom.indexedDB.experimental", false]],
30 info("Opening database");
32 let request = indexedDB.open(name);
33 request.onerror = errorHandler;
34 request.onupgradeneeded = continueToNextStepSync;
35 request.onsuccess = unexpectedSuccessHandler;
40 request.onupgradeneeded = unexpectedSuccessHandler;
41 request.onsuccess = continueToNextStepSync;
43 info("Creating objectStore");
45 request.result.createObjectStore(name);
50 let db = request.result;
52 info("Attempting to create a 'readwriteflush' transaction");
57 db.transaction(name, "readwriteflush");
62 ok(exception, "'readwriteflush' transaction threw");
63 ok(exception instanceof Error, "exception is an Error object");
66 "IDBDatabase.transaction: 'readwriteflush' (value of argument 2) is not " +
67 "a valid value for enumeration IDBTransactionMode.",
68 "exception has the correct message"