| OLD | NEW |
| 1 library IndexedDB3Test; | 1 library IndexedDB3Test; |
| 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:async'; | 4 import 'dart:async'; |
| 5 import 'dart:html' as html; | 5 import 'dart:html' as html; |
| 6 import 'dart:indexed_db'; | 6 import 'dart:indexed_db'; |
| 7 | 7 |
| 8 // Read with cursor. | 8 // Read with cursor. |
| 9 | 9 |
| 10 const String DB_NAME = 'Test'; | 10 const String DB_NAME = 'Test3'; |
| 11 const String STORE_NAME = 'TEST'; | 11 const String STORE_NAME = 'TEST'; |
| 12 const int VERSION = 1; | 12 const int VERSION = 1; |
| 13 | 13 |
| 14 | 14 |
| 15 Future<Database> createAndOpenDb() { | 15 Future<Database> createAndOpenDb() { |
| 16 return html.window.indexedDB.deleteDatabase(DB_NAME).then((_) { | 16 return html.window.indexedDB.deleteDatabase(DB_NAME).then((_) { |
| 17 return html.window.indexedDB.open(DB_NAME, version: VERSION, | 17 return html.window.indexedDB.open(DB_NAME, version: VERSION, |
| 18 onUpgradeNeeded: (e) { | 18 onUpgradeNeeded: (e) { |
| 19 var db = e.target.result; | 19 var db = e.target.result; |
| 20 db.createObjectStore(STORE_NAME); | 20 db.createObjectStore(STORE_NAME); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 }); | 104 }); |
| 105 test('readAll1', () { | 105 test('readAll1', () { |
| 106 return readAllViaCursor(db); | 106 return readAllViaCursor(db); |
| 107 }); | 107 }); |
| 108 | 108 |
| 109 test('readAll2', () { | 109 test('readAll2', () { |
| 110 return readAllReversedViaCursor(db); | 110 return readAllReversedViaCursor(db); |
| 111 }); | 111 }); |
| 112 } | 112 } |
| 113 } | 113 } |
| OLD | NEW |