https://github.com/web-platform-tests/wpt
Raw File
Tip revision: c1dbf959c9037926e712df3222e2879f5d763ab3 authored by Mike Pennisi on 13 February 2017, 17:52:13 UTC
fixup! [webdriver] Update tests
Tip revision: c1dbf95
idbobjectstore_get7.htm
<!DOCTYPE html>
<meta charset="utf-8">
<title>IDBObjectStore.get() - throw DataError when using invalid key </title>
<link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>

<script>
    var db,
      t = async_test();

    var open_rq = createdb(t);
    open_rq.onupgradeneeded = function(e) {
        db = e.target.result;
        db.createObjectStore("store", { keyPath: "key" })
    }

    open_rq.onsuccess = function(e) {
        var store = db.transaction("store")
                      .objectStore("store")
        assert_throws("DataError", function () {
            store.get(null)
        }, "throw DataError when using invalid key.");
        t.done();
    }
</script>

<div id="log"></div>
back to top