Skip to content

Commit

Permalink
Change transaction in different scope to a readonly transaction.
Browse files Browse the repository at this point in the history
Firefox doesn't allow running readwrite transactions in parallel, even with a
different scope. For the purpose of this particular test, it shouldn't matter
if it is a readwrite or readonly transaction.

Differential Revision: https://phabricator.services.mozilla.com/D55672

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1497007
gecko-commit: 38516e564ad923a54cea44209683245322dd3456
gecko-integration-branch: autoland
gecko-reviewers: dom-workers-and-storage-reviewers, asuth, janv
  • Loading branch information
sigiesec authored and moz-wptsync-bot committed Jan 17, 2020
1 parent 11a8797 commit 57cc6fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions IndexedDB/idb-explicit-commit.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ promise_test(async testCase => {
txn2.commit();

// Exercise the IndexedDB transaction ordering by executing one with a
// different scope.
const txn3 = db.transaction(['not_books'], 'readwrite');
txn3.objectStore('not_books').put({'title': 'not_title'}, 'key');
// different scope. A readonly transaction is used here because
// implementations are not required to run non-overlapping readwrite
// transactions in parallel, and some implementations (ex: Firefox)
// will not.
const txn3 = db.transaction(['not_books'], 'readonly');
txn3.objectStore('not_books').getAllKeys();
txn3.oncomplete = function() {
releaseTxnFunction();
}
Expand Down

0 comments on commit 57cc6fd

Please sign in to comment.