tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

idbobjectstore-getAllKeys-enforcerange.any.js (789B)


      1 // META: global=window,worker
      2 // META: title=IndexedDB: IDBIObjectStore getAllKeys() 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.getAllKeys(null, count);
     20            }, `getAllKeys with count ${count} count should throw TypeError`);
     21          });
     22      t.done();
     23    },
     24    `IDBObjectStore.getAllKeys() uses [EnforceRange]`);