| 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("Ensure that aborted VERSION_CHANGE transactions are completely roll
ed back"); | 6 description("Ensure that aborted VERSION_CHANGE transactions are completely roll
ed back"); |
| 7 | 7 |
| 8 indexedDBTest(prepareDatabase, setVersion1Complete); | 8 indexedDBTest(prepareDatabase, setVersion1Complete); |
| 9 function prepareDatabase() | 9 function prepareDatabase() |
| 10 { | 10 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 debug("setVersion1 complete"); | 22 debug("setVersion1 complete"); |
| 23 shouldBe("db.version", "1"); | 23 shouldBe("db.version", "1"); |
| 24 debug(""); | 24 debug(""); |
| 25 db.close(); | 25 db.close(); |
| 26 | 26 |
| 27 evalAndLog("vcreq = indexedDB.open(dbname, 2)"); | 27 evalAndLog("vcreq = indexedDB.open(dbname, 2)"); |
| 28 vcreq.onupgradeneeded = inSetVersion2; | 28 vcreq.onupgradeneeded = inSetVersion2; |
| 29 vcreq.onerror = setVersion2Abort; | 29 vcreq.onerror = setVersion2Abort; |
| 30 vcreq.onblocked = unexpectedBlockedCallback; | 30 vcreq.onblocked = unexpectedBlockedCallback; |
| 31 vcreq.onsuccess = unexpectedSuccessCallback; | 31 vcreq.onsuccess = unexpectedSuccessCallback; |
| 32 expectError(); |
| 32 } | 33 } |
| 33 | 34 |
| 34 function inSetVersion2() | 35 function inSetVersion2() |
| 35 { | 36 { |
| 36 db = event.target.result; | 37 db = event.target.result; |
| 37 debug("setVersion2() callback"); | 38 debug("setVersion2() callback"); |
| 38 shouldBe("db.version", "2"); | 39 shouldBe("db.version", "2"); |
| 39 shouldBeTrue("vcreq.transaction instanceof IDBTransaction"); | 40 shouldBeTrue("vcreq.transaction instanceof IDBTransaction"); |
| 40 trans = vcreq.result; | 41 trans = vcreq.result; |
| 41 trans.onerror = unexpectedErrorCallback; | 42 trans.onerror = unexpectedErrorCallback; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 66 request.onerror = unexpectedErrorCallback; | 67 request.onerror = unexpectedErrorCallback; |
| 67 request.onsuccess = function (e) { | 68 request.onsuccess = function (e) { |
| 68 db = event.target.result; | 69 db = event.target.result; |
| 69 shouldBe("db.version", "1"); | 70 shouldBe("db.version", "1"); |
| 70 shouldBeTrue("db.objectStoreNames.contains('store1')"); | 71 shouldBeTrue("db.objectStoreNames.contains('store1')"); |
| 71 shouldBeFalse("db.objectStoreNames.contains('store2')"); | 72 shouldBeFalse("db.objectStoreNames.contains('store2')"); |
| 72 | 73 |
| 73 finishJSTest(); | 74 finishJSTest(); |
| 74 } | 75 } |
| 75 } | 76 } |
| OLD | NEW |