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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js

Issue 2659513002: Upstream an assortment of IndexedDB tests to WPT. (Closed)
Patch Set: Created 3 years, 10 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 var databaseName = "database"; 1 var databaseName = "database";
2 var databaseVersion = 1; 2 var databaseVersion = 1;
3 3
4 /* Delete created databases 4 /* Delete created databases
5 * 5 *
6 * Go through each finished test, see if it has an associated database. Close 6 * Go through each finished test, see if it has an associated database. Close
7 * that and delete the database. */ 7 * that and delete the database. */
8 add_completion_callback(function(tests) 8 add_completion_callback(function(tests)
9 { 9 {
10 for (var i in tests) 10 for (var i in tests)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 function indexeddb_test(upgrade_func, open_func, description) { 105 function indexeddb_test(upgrade_func, open_func, description) {
106 async_test(function(t) { 106 async_test(function(t) {
107 var dbname = document.location + '-' + t.name; 107 var dbname = document.location + '-' + t.name;
108 var del = indexedDB.deleteDatabase(dbname); 108 var del = indexedDB.deleteDatabase(dbname);
109 del.onerror = t.unreached_func('deleteDatabase should succeed'); 109 del.onerror = t.unreached_func('deleteDatabase should succeed');
110 var open = indexedDB.open(dbname, 1); 110 var open = indexedDB.open(dbname, 1);
111 open.onerror = t.unreached_func('open should succeed'); 111 open.onerror = t.unreached_func('open should succeed');
112 open.onupgradeneeded = t.step_func(function() { 112 open.onupgradeneeded = t.step_func(function() {
113 var db = open.result; 113 var db = open.result;
114 var tx = open.transaction; 114 var tx = open.transaction;
115 var old_abort = tx.abort;
116 tx.abort = function() {
117 open.onerror = null;
118 old_abort.call(tx);
119 };
115 upgrade_func(t, db, tx); 120 upgrade_func(t, db, tx);
116 }); 121 });
117 open.onsuccess = t.step_func(function() { 122 open.onsuccess = t.step_func(function() {
118 var db = open.result; 123 var db = open.result;
119 if (open_func) 124 if (open_func)
120 open_func(t, db); 125 open_func(t, db);
121 }); 126 });
122 }, description); 127 }, description);
123 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698