1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test IndexedDB cursor.update required arguments");
8 indexedDBTest(prepareDatabase);
9 function prepareDatabase()
11 db = event.target.result;
12 objectStore = evalAndLog("db.createObjectStore('autoIncrement', { autoIncrement: true });");
14 request = evalAndLog("request = objectStore.openCursor();");
15 request.onerror = unexpectedErrorCallback;
16 request.onsuccess = function (event) {
23 keys = evalAndLog("keys = [1, -1, 0, 10, 2000, 'q', 'z', 'two', 'b', 'a'];");
25 keyIndex = evalAndLog("keyIndex = 0;");
28 request = evalAndLog("request = objectStore.add('foo', keys[i]);");
29 request.onerror = unexpectedErrorCallback;
30 request.onsuccess = function(event) {
31 if (++keyIndex == keys.length) {
40 request = evalAndLog("request = objectStore.openCursor();");
41 request.onerror = unexpectedErrorCallback;
42 request.onsuccess = function (event) {
43 cursor = evalAndLog("cursor = event.target.result;");
45 shouldThrow("cursor.update();");
47 testFailed("cursor was null");