1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test IndexedDB undefined as record value");
8 indexedDBTest(prepareDatabase);
9 function prepareDatabase()
11 db = event.target.result;
12 event.target.transaction.onabort = unexpectedAbortCallback;
14 objectStore = evalAndLog("objectStore = db.createObjectStore('foo');");
15 result = evalAndLog("result = objectStore.add(undefined, Infinity);");
16 result.onerror = unexpectedErrorCallback;
17 result.onsuccess = getValue;
22 result = evalAndLog("result = objectStore.get(Infinity);");
23 result.onerror = unexpectedErrorCallback;
24 result.onsuccess = checkValue;
29 value = evalAndLog("value = event.target.result;");
30 shouldBe("value", "undefined");
31 result = evalAndLog("result = objectStore.openCursor();");
32 result.onerror = unexpectedErrorCallback;
33 result.onsuccess = checkCursor;
36 function checkCursor()
38 cursor = evalAndLog("cursor = event.target.result;");
40 shouldBe("cursor.key", "Infinity");
41 shouldBe("cursor.value", "undefined");
43 testFailed("cursor is null");