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 database metadata mutation/snapshotting"); | 6 description("Test IndexedDB database metadata mutation/snapshotting"); |
7 | 7 |
8 indexedDBTest(prepareDatabase, snapshotConnection1); | 8 indexedDBTest(prepareDatabase, snapshotConnection1); |
9 function prepareDatabase() | 9 function prepareDatabase() |
10 { | 10 { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 evalAndLog("connection3store1.createIndex('index3', 'path')"); | 63 evalAndLog("connection3store1.createIndex('index3', 'path')"); |
64 | 64 |
65 shouldBe("connection3.version", "3"); | 65 shouldBe("connection3.version", "3"); |
66 shouldBe("connection3.objectStoreNames.length", "3"); | 66 shouldBe("connection3.objectStoreNames.length", "3"); |
67 shouldBe("connection3store1.indexNames.length", "3"); | 67 shouldBe("connection3store1.indexNames.length", "3"); |
68 | 68 |
69 trans.oncomplete = unexpectedCompleteCallback; | 69 trans.oncomplete = unexpectedCompleteCallback; |
70 debug("Connection's properties should be reverted on abort"); | 70 debug("Connection's properties should be reverted on abort"); |
71 evalAndLog("trans.abort()"); | 71 evalAndLog("trans.abort()"); |
72 }; | 72 }; |
73 request.onerror = function() { | 73 request.onerror = function(evt) { |
| 74 evt.preventDefault(); |
| 75 |
74 debug("Connection's properties should be snapshotted on close"); | 76 debug("Connection's properties should be snapshotted on close"); |
75 evalAndLog("connection3.close()"); | 77 evalAndLog("connection3.close()"); |
76 fourthOpen(); | 78 fourthOpen(); |
77 } | 79 }; |
78 } | 80 } |
79 | 81 |
80 function fourthOpen() | 82 function fourthOpen() |
81 { | 83 { |
82 debug(""); | 84 debug(""); |
83 debug("fourthOpen():"); | 85 debug("fourthOpen():"); |
84 evalAndLog("request = indexedDB.open(dbname, 4)"); | 86 evalAndLog("request = indexedDB.open(dbname, 4)"); |
85 request.onerror = unexpectedErrorCallback; | 87 request.onerror = unexpectedErrorCallback; |
86 request.onupgradeneeded = function() { | 88 request.onupgradeneeded = function() { |
87 evalAndLog("connection4 = request.result"); | 89 evalAndLog("connection4 = request.result"); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 shouldBe("connection3store1.indexNames.length", "2"); | 123 shouldBe("connection3store1.indexNames.length", "2"); |
122 debug(""); | 124 debug(""); |
123 | 125 |
124 shouldBe("connection4.version", "4"); | 126 shouldBe("connection4.version", "4"); |
125 shouldBe("connection4.objectStoreNames.length", "3"); | 127 shouldBe("connection4.objectStoreNames.length", "3"); |
126 shouldBe("connection4store1.indexNames.length", "3"); | 128 shouldBe("connection4store1.indexNames.length", "3"); |
127 debug(""); | 129 debug(""); |
128 | 130 |
129 finishJSTest(); | 131 finishJSTest(); |
130 } | 132 } |
OLD | NEW |