idbobjectstore-request-source.any.js (1133B)
1 // META: global=window,worker 2 // META: title=IndexedDB: The source of requests made against object stores 3 // META: script=resources/support.js 4 5 // Spec: https://w3c.github.io/IndexedDB/#dom-idbrequest-source 6 7 'use strict'; 8 9 [ 10 store => store.put(0), 11 store => store.add(0), 12 store => store.delete(0), 13 store => store.clear(), 14 15 store => store.get(0), 16 store => store.getKey(0), 17 store => store.getAll(), 18 store => store.getAllKeys(), 19 store => store.count(), 20 21 store => store.openCursor(), 22 store => store.openKeyCursor() 23 24 ].forEach( 25 func => indexeddb_test( 26 (t, db) => { 27 db.createObjectStore('store', {autoIncrement: true}); 28 }, 29 (t, db) => { 30 const tx = db.transaction('store', 'readwrite'); 31 const store = tx.objectStore('store'); 32 33 assert_equals( 34 func(store).source, store, 35 `${func}.source should be the object store itself`); 36 t.done(); 37 }, 38 `The source of the request from ${ 39 func} is the object store itself`));