Skip to content

Commit

Permalink
IDB: remove relaxed durability from some WPT.
Browse files Browse the repository at this point in the history
These tests used relaxed durability to speed up test runs. Now that all
major browsers use relaxed durability by default, this just adds cruft.

Bug: none
Change-Id: I22ee2e2918ad9f33faa74e49dc6c66b08ce3aa72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6138848
Auto-Submit: Evan Stade <[email protected]>
Reviewed-by: Nathan Memmott <[email protected]>
Commit-Queue: Nathan Memmott <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1401967}
  • Loading branch information
Evan Stade authored and chromium-wpt-export-bot committed Jan 3, 2025
1 parent cdcfaf8 commit b28af71
Show file tree
Hide file tree
Showing 131 changed files with 315 additions and 335 deletions.
2 changes: 1 addition & 1 deletion IndexedDB/bindings-inject-keys-bypass.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ promise_test(async t => {
});
t.add_cleanup(() => { delete Object.prototype['10']; });

const tx = db.transaction('store', 'readwrite', { durability: 'relaxed' });
const tx = db.transaction('store', 'readwrite');
const result = await promiseForRequest(t, tx.objectStore('store').put(
'value', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'key']));

Expand Down
4 changes: 2 additions & 2 deletions IndexedDB/bindings-inject-values-bypass.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ promise_test(async t => {
Object.prototype.a = {b: {c: 'on proto'}};
t.add_cleanup(() => { delete Object.prototype.a; });

const tx = db.transaction('store', 'readwrite', {durability: "relaxed"});
const tx = db.transaction('store', 'readwrite');
tx.objectStore('store').put({});
const result = await promiseForRequest(t, tx.objectStore('store').get(1));

Expand Down Expand Up @@ -40,7 +40,7 @@ promise_test(async t => {
});
t.add_cleanup(() => { delete Object.prototype['id']; });

const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
tx.objectStore('store').put({});
const result = await promiseForRequest(t, tx.objectStore('store').get(1));

Expand Down
4 changes: 2 additions & 2 deletions IndexedDB/blob-composite-blob-reads.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function composite_blob_test({ blobCount, blobSize, name }) {
db.createObjectStore("blobs");
});

const write_tx = db.transaction("blobs", "readwrite", {durability: "relaxed"});
const write_tx = db.transaction("blobs", "readwrite");
let store = write_tx.objectStore("blobs");
store.put(memBlobs, key);
// Make the blobs eligible for GC which is most realistic and most likely
Expand All @@ -42,7 +42,7 @@ function composite_blob_test({ blobCount, blobSize, name }) {

await promiseForTransaction(testCase, write_tx);

const read_tx = db.transaction("blobs", "readonly", {durability: "relaxed"});
const read_tx = db.transaction("blobs", "readonly");
store = read_tx.objectStore("blobs");
const read_req = store.get(key);

Expand Down
4 changes: 2 additions & 2 deletions IndexedDB/blob-contenttype.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ indexeddb_test(
var blob = new Blob(['mulder', 'scully'], {type: type});
assert_equals(blob.type, type, 'Blob type should match constructor option');

var tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
var tx = db.transaction('store', 'readwrite');
tx.objectStore('store').put(blob, 'key');

tx.oncomplete = t.step_func(function() {
var tx = db.transaction('store', 'readonly', {durability: 'relaxed'});
var tx = db.transaction('store', 'readonly');
tx.objectStore('store').get('key').onsuccess =
t.step_func(function(e) {
var result = e.target.result;
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/blob-delete-objectstore-db.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ indexeddb_test(

request.onsuccess = t.step_func(function() {
const blobBContent = "Second blob content";
const trans = db.transaction('store1', 'readwrite', {durability: 'relaxed'});
const trans = db.transaction('store1', 'readwrite');
const store1 = trans.objectStore('store1');
const blobB = new Blob([blobBContent], {"type" : "text/plain"});
store1.put(blobB, key);
Expand Down
6 changes: 3 additions & 3 deletions IndexedDB/blob-valid-after-deletion.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ indexeddb_test(
const blobB = new Blob([blobBContent], {"type" : "text/plain"});
value = { a0: blobA, a1: blobA, b0: blobB };

const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
var store = tx.objectStore('store');

store.put(value, key);
value = null;

const trans = db.transaction('store', 'readonly', {durability: 'relaxed'});
const trans = db.transaction('store', 'readonly');
store = trans.objectStore('store');
const request = store.get(key);

request.onsuccess = t.step_func(function() {
const record = request.result;

trans.oncomplete = t.step_func(function() {
const trans = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const trans = db.transaction('store', 'readwrite');
store = trans.objectStore('store');
const request = store.delete(key);

Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/blob-valid-before-commit.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ indexeddb_test(
const blobB = new Blob([blobBContent], {"type" : "text/plain"});
const value = { a0: blobA, a1: blobA, b0: blobB };

const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
const store = tx.objectStore('store');

store.put(value, key);
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/clone-before-keypath-eval.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function createObjectStoreWithIndex(
}

function createTransactionAndReturnObjectStore(db, storeName) {
const tx = db.transaction(storeName, 'readwrite', {durability: 'relaxed'});
const tx = db.transaction(storeName, 'readwrite');
const store = tx.objectStore(storeName);
return {tx, store};
}
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/close-in-upgradeneeded.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async_test(t => {
assert_equals(db.version, 1);
assert_equals(db.objectStoreNames.length, 1);
assert_throws_dom('InvalidStateError', function() {
db.transaction('os', 'readonly', {durability: 'relaxed'});
db.transaction('os', 'readonly');
});

t.done();
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/cursor-overloads.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async_test(t => {
};

function verifyOverloads() {
trans = db.transaction('store', 'readonly', {durability: 'relaxed'});
trans = db.transaction('store', 'readonly');
store = trans.objectStore('store');
index = store.index('index');

Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/delete-range.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for (const entry of entries) {
db.createObjectStore("store");
},
function open_func(t, db) {
const store = db.transaction("store", "readwrite", {durability: 'relaxed'}).objectStore("store");
const store = db.transaction("store", "readwrite").objectStore("store");

for (let i = 1; i <= 10; ++i) {
store.put(i, i);
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/error-attributes.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ indexeddb_test(
db.createObjectStore('store');
},
function(t, db) {
let tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
let tx = db.transaction('store', 'readwrite');
let store = tx.objectStore('store');
let r1 = store.add('value', 'key');
r1.onerror = t.unreached_func('first add should succeed');
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/event-dispatch-active-flag.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function createObjectStore() {
}

function initializeTransaction(t, db, mode = 'readonly') {
const tx = db.transaction('store', mode, {durability: 'relaxed'});
const tx = db.transaction('store', mode);
const release_tx = keep_alive(tx, 'store');
assert_true(
is_transaction_active(tx, 'store'),
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/fire-error-event-exception.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function fire_error_event_test(func, description) {
db.createObjectStore('s');
},
(t, db) => {
const tx = db.transaction('s', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('s', 'readwrite');
tx.oncomplete = t.unreached_func('transaction should abort');
const store = tx.objectStore('s');
store.put(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/fire-success-event-exception.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function fire_success_event_test(func, description) {
db.createObjectStore('s');
},
(t, db) => {
const tx = db.transaction('s', 'readonly', {durability: 'relaxed'});
const tx = db.transaction('s', 'readonly');
tx.oncomplete = t.unreached_func('transaction should abort');
const store = tx.objectStore('s');
const request = store.get(0);
Expand Down
4 changes: 2 additions & 2 deletions IndexedDB/idb-binary-key-detached.htm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
indexeddb_test(
(t, db) => { db.createObjectStore('store'); },
(t, db) => {
const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
const store = tx.objectStore('store');

const array = new Uint8Array([1,2,3,4]);
Expand All @@ -32,7 +32,7 @@
indexeddb_test(
(t, db) => { db.createObjectStore('store'); },
(t, db) => {
const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
const store = tx.objectStore('store');

const array = new Uint8Array([1,2,3,4]);
Expand Down
2 changes: 1 addition & 1 deletion IndexedDB/idb-binary-key-roundtrip.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function assert_buffer_equals(a, b, message) {

// Verifies that a JavaScript value round-trips through IndexedDB as a key.
function check_key_roundtrip_and_done(t, db, key, key_buffer) {
const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
const tx = db.transaction('store', 'readwrite');
const store = tx.objectStore('store');

// Verify put with key
Expand Down
8 changes: 4 additions & 4 deletions IndexedDB/idbcursor-advance-continue-async.htm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -61,7 +61,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -107,7 +107,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -146,7 +146,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down
4 changes: 2 additions & 2 deletions IndexedDB/idbcursor-advance-exception-order.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
store.put('value', 'key');
},
(t, db) => {
const tx = db.transaction('s', 'readonly', {durability: 'relaxed'});
const tx = db.transaction('s', 'readonly');
const store = tx.objectStore('s');

const r = store.openKeyCursor();
Expand Down Expand Up @@ -66,7 +66,7 @@
store.put('value', 'key');
},
(t, db) => {
const tx = db.transaction('s', 'readonly', {durability: 'relaxed'});
const tx = db.transaction('s', 'readonly');
const store = tx.objectStore('s');

const r = store.openKeyCursor();
Expand Down
12 changes: 6 additions & 6 deletions IndexedDB/idbcursor-advance-invalid.htm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -54,7 +54,7 @@
indexeddb_test(
upgrade_func,
function(t, db) {
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
Expand Down Expand Up @@ -85,7 +85,7 @@
indexeddb_test(
upgrade_func,
function(t, db) {
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
Expand All @@ -111,7 +111,7 @@
indexeddb_test(
upgrade_func,
function(t, db) {
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
Expand All @@ -129,7 +129,7 @@
indexeddb_test(
upgrade_func,
function(t, db) {
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
Expand Down Expand Up @@ -167,7 +167,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
var cursor = e.target.result;
Expand Down
12 changes: 6 additions & 6 deletions IndexedDB/idbcursor-advance.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor();
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor();

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -64,7 +64,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index").openCursor(null, "prev");
var rq = db.transaction("test", "readonly").objectStore("test").index("index").openCursor(null, "prev");

rq.onsuccess = t.step_func(function(e) {
if (!e.target.result) {
Expand Down Expand Up @@ -106,7 +106,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index")
var rq = db.transaction("test", "readonly").objectStore("test").index("index")
.openCursor();

rq.onsuccess = t.step_func(function(e) {
Expand Down Expand Up @@ -139,7 +139,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index")
var rq = db.transaction("test", "readonly").objectStore("test").index("index")
.openCursor(IDBKeyRange.lowerBound("cupcake", true));

rq.onsuccess = t.step_func(function(e) {
Expand Down Expand Up @@ -177,7 +177,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index")
var rq = db.transaction("test", "readonly").objectStore("test").index("index")
.openCursor("pancake");

rq.onsuccess = t.step_func(function(e) {
Expand Down Expand Up @@ -210,7 +210,7 @@
upgrade_func,
function(t, db) {
var count = 0;
var rq = db.transaction("test", "readonly", {durability: 'relaxed'}).objectStore("test").index("index")
var rq = db.transaction("test", "readonly").objectStore("test").index("index")
.openCursor("pie");

rq.onsuccess = t.step_func(function(e) {
Expand Down
6 changes: 3 additions & 3 deletions IndexedDB/idbcursor-continue-exception-order.htm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
s.put('value', 'key');
},
(t, db) => {
const s = db.transaction('s', 'readonly', {durability: 'relaxed'}).objectStore('s');
const s = db.transaction('s', 'readonly').objectStore('s');
const r = s.openKeyCursor();
r.onsuccess = t.step_func(() => {
r.onsuccess = null;
Expand All @@ -36,7 +36,7 @@
s.put('value', 'key');
},
(t, db) => {
const s = db.transaction('s', 'readonly', {durability: 'relaxed'}).objectStore('s');
const s = db.transaction('s', 'readonly').objectStore('s');
const r = s.openKeyCursor();
r.onsuccess = t.step_func(() => {
r.onsuccess = null;
Expand All @@ -62,7 +62,7 @@
s.put('value', 'key');
},
(t, db) => {
const s = db.transaction('s', 'readonly', {durability: 'relaxed'}).objectStore('s');
const s = db.transaction('s', 'readonly').objectStore('s');
const r = s.openKeyCursor();
r.onsuccess = t.step_func(() => {
r.onsuccess = null;
Expand Down
Loading

0 comments on commit b28af71

Please sign in to comment.