Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>IndexedDB: UpgradeNeeded Tests</title> | |
|
Marijn Kruisselbrink
2016/06/06 23:09:10
This seems wrong?
palakj1
2016/06/07 00:11:16
Sorry. updated.
| |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharnessreport.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 | |
| 8 function callback(){ | |
| 9 console.log('callit'); | |
|
Marijn Kruisselbrink
2016/06/06 23:09:10
Logging to the console almost never seems like the
palakj1
2016/06/07 00:11:16
Done
| |
| 10 } | |
| 11 | |
| 12 (function () { | |
|
Marijn Kruisselbrink
2016/06/06 23:09:10
Wrapping the async_test inside a (function() { ...
palakj1
2016/06/07 00:11:16
Got your point. Done.
| |
| 13 async_test(function(t) { | |
| 14 var description = 'observers constructor test'; | |
| 15 var dbname = location.pathname + ' - ' + description; | |
| 16 var openRequest = indexedDB.open(dbname); | |
| 17 var obs1 = new IDBObserver(callback, {transaction: true, values: true}); | |
| 18 openRequest.onupgradeneeded= t.step_func(function() { | |
| 19 var db = openRequest.result; | |
| 20 db.createObjectStore('store'); | |
| 21 }); | |
| 22 openRequest.onsuccess = t.step_func(function() { | |
| 23 var db = openRequest.result; | |
| 24 var tx = db.transaction('store', 'readwrite'); | |
| 25 obs1.observe(db,tx); | |
| 26 t.done(); | |
| 27 }); | |
| 28 | |
| 29 }, 'observers constructor test'); | |
| 30 }()); | |
| 31 | |
| 32 | |
|
Marijn Kruisselbrink
2016/06/06 23:09:10
Maybe also run the same tests from a worker contex
palakj1
2016/06/07 00:11:16
I'll work on this.
| |
| 33 </script> | |
| OLD | NEW |