Issue #1693 - Use scoped enums for IDBTransaction.

Based on a patch from Mozilla bug 1598164.
Needed due to identifier collision between NSS and IDBTransaction.

Co-authored by: Simon Giesecke <simon.giesecke@gmail.com>
Co-authored by: Matt A. Tobin <email@mattatobin.com>
This commit is contained in:
Job Bautista 2023-03-03 20:07:55 +08:00 committed by roytam1
commit c920f32df3
25 changed files with 175 additions and 182 deletions

View file

@ -12,7 +12,7 @@
<script type="text/javascript;version=1.7">
function testSteps()
{
const READ_WRITE = "readwrite";
const Mode::ReadWrite = "readwrite";
const name = window.location.pathname;
@ -40,7 +40,7 @@
is(event.type, "success", "Got correct event type");
let trans = db.transaction([objectStoreName], READ_WRITE);
let trans = db.transaction([objectStoreName], Mode::ReadWrite);
objectStore = trans.objectStore(objectStoreName);
objectStore.delete(fileData.key);
@ -50,7 +50,7 @@
is(getFileDBRefCount(name, 1), 0, "Correct db ref count");
trans = db.transaction([objectStoreName], READ_WRITE);
trans = db.transaction([objectStoreName], Mode::ReadWrite);
objectStore = trans.objectStore(objectStoreName);
request = objectStore.add(fileData.file, fileData.key);
@ -81,7 +81,7 @@
let db = event.target.result;
db.onerror = errorHandler;
let trans = db.transaction([objectStoreName], READ_WRITE);
let trans = db.transaction([objectStoreName], Mode::ReadWrite);
objectStore = trans.objectStore(objectStoreName);
request = objectStore.get(fileData.key);
@ -98,7 +98,7 @@
is(getFileDBRefCount(name, 1), 0, "Correct db ref count");
trans = db.transaction([objectStoreName], READ_WRITE);
trans = db.transaction([objectStoreName], Mode::ReadWrite);
objectStore = trans.objectStore(objectStoreName);
request = objectStore.add(result, fileData.key);