OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <!-- | 3 <!-- |
4 Copyright 2014 The Chromium Authors. All rights reserved. | 4 Copyright 2014 The Chromium Authors. All rights reserved. |
5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
6 found in the LICENSE file. | 6 found in the LICENSE file. |
7 --> | 7 --> |
8 <head> | 8 <head> |
9 <title>IDB test that db's corrupted while open are properly handled Part 1 / 2</
title> | 9 <title>IDB test that db's corrupted while open are properly handled Part 1 / 2</
title> |
10 <script type="text/javascript" src="common.js"></script> | 10 <script type="text/javascript" src="common.js"></script> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 shouldBe("numTransactionErrors", "0"); | 133 shouldBe("numTransactionErrors", "0"); |
134 shouldBe("numTransactionAborts", "1"); | 134 shouldBe("numTransactionAborts", "1"); |
135 | 135 |
136 done("Closed as expected"); | 136 done("Closed as expected"); |
137 }; | 137 }; |
138 testXhr("/corrupt/test/fail?class=LevelDBTransaction&method=Commit", functio
n() { | 138 testXhr("/corrupt/test/fail?class=LevelDBTransaction&method=Commit", functio
n() { |
139 request = objectStore.put("Any Value", 'key-0'); | 139 request = objectStore.put("Any Value", 'key-0'); |
140 request.onerror = requestError; | 140 request.onerror = requestError; |
141 }); | 141 }); |
142 }, | 142 }, |
143 failWebkitGetDatabaseNames: function() { | |
144 tests.testCommon('readonly'); | |
145 gotRequestError = 0; | |
146 db.onclose = function(event) { | |
147 shouldBe("numTransactionErrors", "0"); | |
148 shouldBe("numTransactionAborts", "1"); | |
149 shouldBe("gotRequestError", "1"); | |
150 | |
151 done("Closed as expected"); | |
152 }; | |
153 testXhr("/corrupt/test/fail?class=LevelDBIterator&method=Seek", function() { | |
154 request = window.indexedDB.webkitGetDatabaseNames(); | |
155 request.onsuccess = unexpectedSuccessCallback; | |
156 request.onerror = function(evt) { | |
157 gotRequestError += 1; | |
158 }; | |
159 }); | |
160 }, | |
161 iterate: function() { | 143 iterate: function() { |
162 testXhr("/corrupt/test/corruptdb?storeName", function() { | 144 testXhr("/corrupt/test/corruptdb?storeName", function() { |
163 tests.testCommon('readonly'); | 145 tests.testCommon('readonly'); |
164 request = objectStore.openCursor(); | 146 request = objectStore.openCursor(); |
165 request.onerror = requestError; | 147 request.onerror = requestError; |
166 request.onsuccess = function (event){ | 148 request.onsuccess = function (event){ |
167 var cursor = request.result; | 149 var cursor = request.result; |
168 if (cursor) { | 150 if (cursor) { |
169 // Get an object. Probably shouldn't get this far, but won't call this
an error. | 151 // Get an object. Probably shouldn't get this far, but won't call this
an error. |
170 cursor.continue(); | 152 cursor.continue(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 else | 189 else |
208 fail('Unknown test: "' + testType + '"'); | 190 fail('Unknown test: "' + testType + '"'); |
209 } | 191 } |
210 | 192 |
211 </script> | 193 </script> |
212 </head> | 194 </head> |
213 <body onLoad="test()"> | 195 <body onLoad="test()"> |
214 <div id="status">Starting...</div> | 196 <div id="status">Starting...</div> |
215 </body> | 197 </body> |
216 </html> | 198 </html> |
OLD | NEW |