tor-browser

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

idbtransaction-objectStore-exception-order.any.js (779B)


      1 // META: global=window,worker
      2 // META: title=IndexedDB: IDBTransaction objectStore() Exception Ordering
      3 // META: script=resources/support.js
      4 
      5 // Spec: https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstore
      6 
      7 'use strict';
      8 
      9 indexeddb_test(
     10    (t, db) => {
     11        const store = db.createObjectStore('s');
     12    },
     13    (t, db) => {
     14        const tx = db.transaction('s', 'readonly');
     15        tx.oncomplete = t.step_func(() => {
     16            assert_throws_dom('InvalidStateError', () => { tx.objectStore('nope'); },
     17                '"finished" check (InvalidStateError) should precede ' +
     18                '"name in scope" check (NotFoundError)');
     19            t.done();
     20        });
     21    },
     22    'IDBTransaction.objectStore exception order: InvalidStateError vs. NotFoundError'
     23 );