| 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 metadata remains correct when an aborted version change
is followed by another. "); | 6 description("Ensure that metadata remains correct when an aborted version change
is followed by another. "); |
| 7 | 7 |
| 8 function test() { | 8 function test() { |
| 9 removeVendorPrefixes(); | 9 removeVendorPrefixes(); |
| 10 setDBNameFromPath(); | 10 setDBNameFromPath(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 request.onupgradeneeded = onUpgradeNeeded2; | 36 request.onupgradeneeded = onUpgradeNeeded2; |
| 37 request.onsuccess = onSuccess; | 37 request.onsuccess = onSuccess; |
| 38 | 38 |
| 39 evalAndLog("transaction.abort()"); | 39 evalAndLog("transaction.abort()"); |
| 40 } | 40 } |
| 41 | 41 |
| 42 function onError(evt) | 42 function onError(evt) |
| 43 { | 43 { |
| 44 preamble(evt); | 44 preamble(evt); |
| 45 shouldBe("db.version", "0"); | 45 shouldBe("db.version", "0"); |
| 46 evt.preventDefault(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 function onUpgradeNeeded2(evt) | 49 function onUpgradeNeeded2(evt) |
| 49 { | 50 { |
| 50 preamble(evt); | 51 preamble(evt); |
| 51 evalAndLog("db = request.result"); | 52 evalAndLog("db = request.result"); |
| 52 shouldBe("db.version", "3"); | 53 shouldBe("db.version", "3"); |
| 53 } | 54 } |
| 54 | 55 |
| 55 function onSuccess(evt) | 56 function onSuccess(evt) |
| 56 { | 57 { |
| 57 preamble(evt); | 58 preamble(evt); |
| 58 evalAndLog("db = request.result"); | 59 evalAndLog("db = request.result"); |
| 59 shouldBe("db.version", "3"); | 60 shouldBe("db.version", "3"); |
| 60 finishJSTest(); | 61 finishJSTest(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 test(); | 64 test(); |
| OLD | NEW |