Revision 95a4dac471e2eb2811555819a623676b597b5997 authored by kritisingh1 on 14 March 2018, 19:47:02 UTC, committed by kritisingh1 on 14 March 2018, 19:47:02 UTC
1 parent 4fa2165
Raw File
idbrequest_error.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>IDBRequest.error</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=support.js></script>

<script>
async_test(t => {
  var open = createdb(t);
  open.onupgradeneeded = t.step_func(e => {
    var db = e.target.result;
    db.createObjectStore('store');
  });
  open.onsuccess = t.step_func(e => {
    var db = e.target.result;
    var request = db.transaction('store').objectStore('store').get(0);

    assert_equals(request.readyState, 'pending');
    assert_throws('InvalidStateError', () => request.error,
                  'IDBRequest.error should throw if request is pending');
    t.done();
  });
}, 'IDBRequest.error throws if ready state is pending');
</script>
back to top