| 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 specifying a version when opening a non-existent db cause
s an upgradeneeded event and that the version number is set correctly."); | 6 description("Test that specifying a version when opening a non-existent db cause
s an upgradeneeded event and that the version number is set correctly."); |
| 7 | 7 |
| 8 function test() | 8 function test() |
| 9 { | 9 { |
| 10 removeVendorPrefixes(); | |
| 11 setDBNameFromPath(); | 10 setDBNameFromPath(); |
| 12 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); | 11 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); |
| 13 request.onsuccess = deleteSuccess; | 12 request.onsuccess = deleteSuccess; |
| 14 request.onerror = unexpectedErrorCallback; | 13 request.onerror = unexpectedErrorCallback; |
| 15 request.onblocked = unexpectedBlockedCallback; | 14 request.onblocked = unexpectedBlockedCallback; |
| 16 } | 15 } |
| 17 | 16 |
| 18 function deleteSuccess(evt) { | 17 function deleteSuccess(evt) { |
| 19 debug("Should trigger:"); | 18 debug("Should trigger:"); |
| 20 debug("4.1.4: If no database with the given name from the origin origin was
found, or if it was deleted during the previous step, then create a database wit
h name name, with 0 as version, and with no object stores. Let db be the new dat
abase."); | 19 debug("4.1.4: If no database with the given name from the origin origin was
found, or if it was deleted during the previous step, then create a database wit
h name name, with 0 as version, and with no object stores. Let db be the new dat
abase."); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 shouldBe("sawUpgradeNeeded", "true"); | 66 shouldBe("sawUpgradeNeeded", "true"); |
| 68 shouldBeTrue("sawTransactionComplete"); | 67 shouldBeTrue("sawTransactionComplete"); |
| 69 db = evalAndLog("db = event.target.result"); | 68 db = evalAndLog("db = event.target.result"); |
| 70 debug("Kind of test 4.1.9:"); | 69 debug("Kind of test 4.1.9:"); |
| 71 shouldBeEqualToString("String(db)", "[object IDBDatabase]"); | 70 shouldBeEqualToString("String(db)", "[object IDBDatabase]"); |
| 72 shouldBe('db.version', "7"); | 71 shouldBe('db.version', "7"); |
| 73 finishJSTest(); | 72 finishJSTest(); |
| 74 } | 73 } |
| 75 | 74 |
| 76 test(); | 75 test(); |
| OLD | NEW |