OLD | NEW |
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../../../resources/js-test.js'); | 2 importScripts('../../../resources/js-test.js'); |
3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
4 } | 4 } |
5 | 5 |
6 description("Test IndexedDB workers, recursion, and transaction termination."); | 6 description("Test IndexedDB workers, recursion, and transaction termination."); |
7 | 7 |
8 indexedDBTest(prepareDatabase, createTransaction); | 8 indexedDBTest(prepareDatabase, createTransaction); |
9 function prepareDatabase(evt) | 9 function prepareDatabase(evt) |
10 { | 10 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 debug(""); | 98 debug(""); |
99 debug("errorHandler():"); | 99 debug("errorHandler():"); |
100 // FIXME: Should be able to stop the error here, but it isn't an Event objec
t. | 100 // FIXME: Should be able to stop the error here, but it isn't an Event objec
t. |
101 // evalAndLog("event.preventDefault()"); | 101 // evalAndLog("event.preventDefault()"); |
102 evalAndLog("self.onerror = self.old_onerror"); | 102 evalAndLog("self.onerror = self.old_onerror"); |
103 evalAndLog("transaction = db.transaction('store')"); | 103 evalAndLog("transaction = db.transaction('store')"); |
104 evalAndLog("store = transaction.objectStore('store')"); | 104 evalAndLog("store = transaction.objectStore('store')"); |
105 transaction.onerror = unexpectedErrorCallback; | 105 transaction.onerror = unexpectedErrorCallback; |
106 transaction.onabort = unexpectedAbortCallback; | 106 transaction.onabort = unexpectedAbortCallback; |
107 transaction.oncomplete = errorTransactionCompleted; | 107 transaction.oncomplete = errorTransactionCompleted; |
| 108 // We will cancel the error event here itself, |
| 109 // this will allow the transaction to complete. |
| 110 // Thus the event.preventDefault in the worker.onerror |
| 111 // is no longer required in this scenario. |
| 112 return true; |
108 } | 113 } |
109 | 114 |
110 function errorTransactionCompleted() | 115 function errorTransactionCompleted() |
111 { | 116 { |
112 testPassed("Transaction completed"); | 117 testPassed("Transaction completed"); |
113 evalAndExpectException("store.get(0)", "0", "'TransactionInactiveError'"); | 118 evalAndExpectException("store.get(0)", "0", "'TransactionInactiveError'"); |
114 finishJSTest(); | 119 finishJSTest(); |
115 } | 120 } |
OLD | NEW |