diff options
Diffstat (limited to 'LayoutTests/storage/indexeddb/script-tests/open-cursor.js')
-rw-r--r-- | LayoutTests/storage/indexeddb/script-tests/open-cursor.js | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js deleted file mode 100644 index 53ea96b..0000000 --- a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js +++ /dev/null @@ -1,83 +0,0 @@ -description("Test IndexedDB's openCursor."); -if (window.layoutTestController) - layoutTestController.waitUntilDone(); - -function emptyCursorSuccess() -{ - debug("Empty cursor opened successfully.") - verifySuccessEvent(event); - // FIXME: check that we can iterate the cursor. - done(); -} - -function openEmptyCursor() -{ - debug("Opening an empty cursor."); - keyRange = IDBKeyRange.leftBound("InexistentKey"); - result = evalAndLog("objectStore.openCursor(keyRange)"); - verifyResult(result); - result.onsuccess = emptyCursorSuccess; - result.onerror = unexpectedErrorCallback; -} - -function cursorSuccess() -{ - debug("Cursor opened successfully.") - verifySuccessEvent(event); - // FIXME: check that we can iterate the cursor. - shouldBe("event.result.direction", "0"); - shouldBe("event.result.key", "'myKey'"); - shouldBe("event.result.value", "'myValue'"); - debug(""); - openEmptyCursor(); -} - -function openCursor() -{ - debug("Opening cursor"); - keyRange = IDBKeyRange.leftBound("myKey"); - result = evalAndLog("objectStore.openCursor(keyRange)"); - verifyResult(result); - result.onsuccess = cursorSuccess; - result.onerror = unexpectedErrorCallback; -} - -function populateObjectStore(objectStore) -{ - result = evalAndLog("objectStore.add('myValue', 'myKey')"); - verifyResult(result); - result.onsuccess = openCursor; - result.onerror = unexpectedErrorCallback; -} - -function createObjectStoreSuccess() -{ - verifySuccessEvent(event); - var objectStore = evalAndLog("objectStore = event.result"); - populateObjectStore(objectStore); -} - -function openSuccess() -{ - verifySuccessEvent(event); - var db = evalAndLog("db = event.result"); - - deleteAllObjectStores(db); - - result = evalAndLog("db.createObjectStore('test')"); - verifyResult(result); - result.onsuccess = createObjectStoreSuccess; - result.onerror = unexpectedErrorCallback; -} - -function test() -{ - result = evalAndLog("indexedDB.open('name', 'description')"); - verifyResult(result); - result.onsuccess = openSuccess; - result.onerror = unexpectedErrorCallback; -} - -test(); - -var successfullyParsed = true; |