Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: content/test/data/indexeddb/corrupted_open_db_detection.html

Issue 2964743002: Revert "Indexed DB: Remove nonstandard IDBFactory.webkitGetDatabaseNames()" (Closed)
Patch Set: Undeprecate Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 },
143 iterate: function() { 161 iterate: function() {
144 testXhr("/corrupt/test/corruptdb?storeName", function() { 162 testXhr("/corrupt/test/corruptdb?storeName", function() {
145 tests.testCommon('readonly'); 163 tests.testCommon('readonly');
146 request = objectStore.openCursor(); 164 request = objectStore.openCursor();
147 request.onerror = requestError; 165 request.onerror = requestError;
148 request.onsuccess = function (event){ 166 request.onsuccess = function (event){
149 var cursor = request.result; 167 var cursor = request.result;
150 if (cursor) { 168 if (cursor) {
151 // Get an object. Probably shouldn't get this far, but won't call this an error. 169 // Get an object. Probably shouldn't get this far, but won't call this an error.
152 cursor.continue(); 170 cursor.continue();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 else 207 else
190 fail('Unknown test: "' + testType + '"'); 208 fail('Unknown test: "' + testType + '"');
191 } 209 }
192 210
193 </script> 211 </script>
194 </head> 212 </head>
195 <body onLoad="test()"> 213 <body onLoad="test()">
196 <div id="status">Starting...</div> 214 <div id="status">Starting...</div>
197 </body> 215 </body>
198 </html> 216 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698