idbobjectstore-getAll-enforcerange.any.js (772B)
1 // META: global=window,worker 2 // META: title=IndexedDB: IDBObjectStore getAll() uses [EnforceRange] 3 // META: script=resources/support.js 4 5 // Spec: https://w3c.github.io/IndexedDB/#object-store-interface 6 7 'use strict'; 8 9 indexeddb_test( 10 (t, db) => { 11 const store = db.createObjectStore('store'); 12 }, 13 (t, db) => { 14 const tx = db.transaction('store', 'readonly'); 15 const store = tx.objectStore('store'); 16 [NaN, Infinity, -Infinity, -1, -Number.MAX_SAFE_INTEGER].forEach( 17 count => { 18 assert_throws_js(TypeError, () => { 19 store.getAll(null, count); 20 }, `getAll with count ${count} count should throw TypeError`); 21 }); 22 t.done(); 23 }, 24 `IDBObjectStore.getAll() uses [EnforceRange]`);