| <script> |
| |
| var request = window.indexedDB.deleteDatabase("IndexedDBMultiProcess"); |
| request.onsuccess = function(e) |
| { |
| continueTest(); |
| } |
| request.onerror = function(e) |
| { |
| // Unexpected error |
| window.webkit.messageHandlers.testHandler.postMessage('Error deleting database'); |
| } |
| |
| function continueTest() |
| { |
| var request = window.indexedDB.open("IndexedDBMultiProcess", 2); |
| |
| request.onsuccess = function() |
| { |
| window.webkit.messageHandlers.testHandler.postMessage('Open success'); |
| } |
| |
| request.onerror = function() |
| { |
| // Unexpected error |
| window.webkit.messageHandlers.testHandler.postMessage('Unexpected error opening database'); |
| } |
| |
| request.onupgradeneeded = function(event) |
| { |
| window.webkit.messageHandlers.testHandler.postMessage('UpgradeNeeded'); |
| |
| var store = event.target.result.createObjectStore("TestObjectStore"); |
| |
| event.target.transaction.oncomplete = function() { |
| window.webkit.messageHandlers.testHandler.postMessage('Transaction complete'); |
| } |
| |
| event.target.transaction.onerror = function() { |
| window.webkit.messageHandlers.testHandler.postMessage('Transaction errored!'); |
| } |
| |
| store.put("bar", "foo"); |
| } |
| } |
| </script> |