2 <script src=
"../../resources/js-test.js"></script>
3 <script src=
"resources/shared.js"></script>
6 description("Ensure cursor wrappers are created correctly.");
8 indexedDBTest(prepareDatabase
, verifyWrappers
);
9 function prepareDatabase(evt
)
12 evalAndLog("db = event.target.result");
13 evalAndLog("store = db.createObjectStore('store')");
14 evalAndLog("store.put(0, 0)");
17 function verifyWrappers(evt
)
20 evalAndLog("db = event.target.result");
21 evalAndLog("tx = db.transaction('store', 'readwrite')");
22 evalAndLog("request = tx.objectStore('store').openCursor()");
24 request
.onsuccess
= function onOpenCursorSuccess(evt
) {
26 evalAndLog("cursor = event.target.result");
27 evalAndLog("request = cursor.update(1)");
29 request
.onsuccess
= function onUpdateSuccess(evt
) {
31 evalAndLog("cursor = null");
33 setTimeout(checkCursorType
, 0);
38 function checkCursorType() {
39 shouldBeEqualToString("request.source.toString()", "[object IDBCursorWithValue]");