| 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 that deleteDatabase is not blocked when connections close in o
n versionchange callback"); | 6 description("Test that deleteDatabase is not blocked when connections close in o
n versionchange callback"); |
| 7 | 7 |
| 8 function test() { | 8 function test() { |
| 9 removeVendorPrefixes(); | |
| 10 setDBNameFromPath(); | 9 setDBNameFromPath(); |
| 11 | 10 |
| 12 request = evalAndLog("indexedDB.open(dbname)"); | 11 request = evalAndLog("indexedDB.open(dbname)"); |
| 13 request.onblocked = unexpectedBlockedCallback; | 12 request.onblocked = unexpectedBlockedCallback; |
| 14 request.onerror = unexpectedErrorCallback; | 13 request.onerror = unexpectedErrorCallback; |
| 15 request.onsuccess = function openOnSuccess(evt) { | 14 request.onsuccess = function openOnSuccess(evt) { |
| 16 preamble(evt); | 15 preamble(evt); |
| 17 evalAndLog("h = event.target.result"); | 16 evalAndLog("h = event.target.result"); |
| 18 | 17 |
| 19 h.onversionchange = function onVersionChange(evt) { | 18 h.onversionchange = function onVersionChange(evt) { |
| 20 preamble(evt); | 19 preamble(evt); |
| 21 shouldBe("event.target.version", "1"); | 20 shouldBe("event.target.version", "1"); |
| 22 shouldBe("event.oldVersion", "1"); | 21 shouldBe("event.oldVersion", "1"); |
| 23 shouldBeNull("event.newVersion"); | 22 shouldBeNull("event.newVersion"); |
| 24 evalAndLog("h.close()"); | 23 evalAndLog("h.close()"); |
| 25 }; | 24 }; |
| 26 | 25 |
| 27 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); | 26 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); |
| 28 request.onerror = unexpectedErrorCallback; | 27 request.onerror = unexpectedErrorCallback; |
| 29 request.onblocked = unexpectedBlockedCallback; | 28 request.onblocked = unexpectedBlockedCallback; |
| 30 request.onsuccess = function deleteDatabaseOnSuccess(evt) { | 29 request.onsuccess = function deleteDatabaseOnSuccess(evt) { |
| 31 preamble(evt); | 30 preamble(evt); |
| 32 testPassed("blocked event was not fired"); | 31 testPassed("blocked event was not fired"); |
| 33 finishJSTest(); | 32 finishJSTest(); |
| 34 }; | 33 }; |
| 35 }; | 34 }; |
| 36 } | 35 } |
| 37 | 36 |
| 38 test(); | 37 test(); |
| OLD | NEW |