| OLD | NEW |
| 1 library IndexedDB1Test; | 1 library IndexedDB1Test; |
| 2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
| 3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import '../../pkg/unittest/lib/html_config.dart'; |
| 4 import 'dart:html' as html; | 4 import 'dart:html' as html; |
| 5 import 'dart:indexed_db' as idb; | 5 import 'dart:indexed_db' as idb; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'utils.dart'; | 7 import 'utils.dart'; |
| 8 | 8 |
| 9 // Write and re-read Maps: simple Maps; Maps with DAGs; Maps with cycles. | 9 // Write and re-read Maps: simple Maps; Maps with DAGs; Maps with cycles. |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 var object = e.target.result; | 36 var object = e.target.result; |
| 37 db.close(); | 37 db.close(); |
| 38 check(value, object); | 38 check(value, object); |
| 39 })); | 39 })); |
| 40 request.onError.listen(fail); | 40 request.onError.listen(fail); |
| 41 } | 41 } |
| 42 | 42 |
| 43 step1() { | 43 step1() { |
| 44 var transaction = db.transaction([storeName], 'readwrite'); | 44 var transaction = db.transaction([storeName], 'readwrite'); |
| 45 var request = transaction.objectStore(storeName).put(value, key); | 45 var request = transaction.objectStore(storeName).put(value, key); |
| 46 request.onSuccess.listen(expectAsync1(step2)); | |
| 47 request.onError.listen(fail); | 46 request.onError.listen(fail); |
| 47 |
| 48 transaction.onComplete.listen(expectAsync1(step2)); |
| 48 } | 49 } |
| 49 | 50 |
| 50 initDb(e) { | 51 initDb(e) { |
| 51 db = e.target.result; | 52 db = e.target.result; |
| 52 if (version != db.version) { | 53 if (version != db.version) { |
| 53 // Legacy 'setVersion' upgrade protocol. | 54 // Legacy 'setVersion' upgrade protocol. |
| 54 var request = db.setVersion('$version'); | 55 var request = db.setVersion('$version'); |
| 55 request.onSuccess.listen( | 56 request.onSuccess.listen( |
| 56 expectAsync1((e) { | 57 expectAsync1((e) { |
| 57 createObjectStore(db); | 58 createObjectStore(db); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 go('test_DAG', obj2); | 130 go('test_DAG', obj2); |
| 130 go('test_cycle', obj3); | 131 go('test_cycle', obj3); |
| 131 go('test_simple_splay', obj4); | 132 go('test_simple_splay', obj4); |
| 132 go('const_array_1', const [const [1], const [2]]); | 133 go('const_array_1', const [const [1], const [2]]); |
| 133 go('const_array_dag', const [const [1], const [1]]); | 134 go('const_array_dag', const [const [1], const [1]]); |
| 134 go('array_deferred_copy', [1,2,3, obj3, obj3, 6]); | 135 go('array_deferred_copy', [1,2,3, obj3, obj3, 6]); |
| 135 go('array_deferred_copy_2', [1,2,3, [4, 5, obj3], [obj3, 6]]); | 136 go('array_deferred_copy_2', [1,2,3, [4, 5, obj3], [obj3, 6]]); |
| 136 go('cyclic_list', cyclic_list); | 137 go('cyclic_list', cyclic_list); |
| 137 } | 138 } |
| 138 } | 139 } |
| OLD | NEW |