Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /IndexedDB/idbobjectstore_openCursor_invalid.any.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbobjectstore_openCursor_invalid.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbobjectstore_openCursor_invalid.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /IndexedDB/idbobjectstore_openCursor_invalid.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
// META: title=IDBObjectStore.openCursor() - invalid
// META: script=resources/support.js
'use strict';
indexeddb_test(
function(t, db, tx) {
let objStore = db.createObjectStore('test');
objStore.createIndex('index', '');
objStore.add('data', 1);
objStore.add('data2', 2);
},
function(t, db, tx) {
let idx =
db.transaction('test', 'readonly').objectStore('test').index('index');
assert_throws_dom('DataError', function() {
idx.openCursor({lower: 'a'});
});
assert_throws_dom('DataError', function() {
idx.openCursor({lower: 'a', lowerOpen: false});
});
assert_throws_dom('DataError', function() {
idx.openCursor(
{lower: 'a', lowerOpen: false, upper: null, upperOpen: false});
});
t.done();
},
'IDBObjectStore.openCursor() - invalid - pass something other than number');