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

Side by Side Diff: LayoutTests/storage/indexeddb/resources/odd-strings.js

Issue 243523003: Fire window.onerror for uncaught IndexedDB errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove FIXMEs Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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 odd value datatypes"); 6 description("Test IndexedDB odd value datatypes");
7 7
8 function test() 8 function test()
9 { 9 {
10 removeVendorPrefixes(); 10 removeVendorPrefixes();
(...skipping 18 matching lines...) Expand all
29 if (++numDeleted == testData.length) 29 if (++numDeleted == testData.length)
30 openNextDatabase(); 30 openNextDatabase();
31 }; 31 };
32 } 32 }
33 } 33 }
34 34
35 function openNextDatabase() 35 function openNextDatabase()
36 { 36 {
37 debug("opening a database named " + testData[nextToOpen].description); 37 debug("opening a database named " + testData[nextToOpen].description);
38 request = evalAndLog("indexedDB.open(testData[nextToOpen].name, 1)"); 38 request = evalAndLog("indexedDB.open(testData[nextToOpen].name, 1)");
39 request.onsuccess = unexpectedSuccessCallback;
40 request.onblocked = unexpectedBlockedCallback; 39 request.onblocked = unexpectedBlockedCallback;
41 request.onupgradeneeded = addAKey; 40 request.onupgradeneeded = addAKey;
41 request.onsuccess = closeDatabase;
ericu 2014/06/19 00:54:05 Can you talk me through this change? Why are we n
jsbell 2014/06/19 01:13:24 Previously, the test was closing the database in t
ericu 2014/06/19 01:18:40 OK.
42 } 42 }
43 43
44 function addAKey() 44 function addAKey()
45 { 45 {
46 db = event.target.result; 46 db = event.target.result;
47 evalAndLog("objectStore = db.createObjectStore(testData[nextToOpen].name);") ; 47 evalAndLog("objectStore = db.createObjectStore(testData[nextToOpen].name);") ;
48 evalAndLog("index = objectStore.createIndex(testData[nextToOpen].name, 'keyP ath');"); 48 evalAndLog("index = objectStore.createIndex(testData[nextToOpen].name, 'keyP ath');");
49 evalAndLog("key = testData[nextToOpen].name"); 49 evalAndLog("key = testData[nextToOpen].name");
50 evalAndLog("request = objectStore.add(key, key);"); 50 evalAndLog("request = objectStore.add(key, key);");
51 request.onsuccess = closeDatabase;
52 request.onerror = unexpectedErrorCallback; 51 request.onerror = unexpectedErrorCallback;
53 } 52 }
54 53
55 function closeDatabase() 54 function closeDatabase()
56 { 55 {
57 evalAndLog("db.close()"); 56 evalAndLog("db.close()");
58 debug(""); 57 debug("");
59 if (++nextToOpen < testData.length) { 58 if (++nextToOpen < testData.length) {
60 openNextDatabase(); 59 openNextDatabase();
61 } else { 60 } else {
(...skipping 28 matching lines...) Expand all
90 shouldBe("cursor.value", "testData[nextToOpen].name"); 89 shouldBe("cursor.value", "testData[nextToOpen].name");
91 if (++nextToOpen < testData.length) { 90 if (++nextToOpen < testData.length) {
92 debug(""); 91 debug("");
93 verifyNextDatabase(); 92 verifyNextDatabase();
94 } else { 93 } else {
95 finishJSTest(); 94 finishJSTest();
96 } 95 }
97 } 96 }
98 97
99 test(); 98 test();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698