OLD | NEW |
1 #library('IndexedDB3Test'); | 1 #library('IndexedDB3Test'); |
2 #import('../../pkg/unittest/unittest.dart'); | 2 #import('../../pkg/unittest/unittest.dart'); |
3 #import('../../pkg/unittest/html_config.dart'); | 3 #import('../../pkg/unittest/html_config.dart'); |
4 #import('dart:html'); | 4 #import('dart:html'); |
5 | 5 |
6 // Read with cursor. | 6 // Read with cursor. |
7 | 7 |
8 final String DB_NAME = 'Test'; | 8 const String DB_NAME = 'Test'; |
9 final String STORE_NAME = 'TEST'; | 9 const String STORE_NAME = 'TEST'; |
10 final String VERSION = '1'; | 10 const String VERSION = '1'; |
11 | 11 |
12 class Test { | 12 class Test { |
13 var db; | 13 var db; |
14 | 14 |
15 start() { | 15 start() { |
16 var request = window.indexedDB.open(DB_NAME); | 16 var request = window.indexedDB.open(DB_NAME); |
17 Expect.isNotNull(request); | 17 Expect.isNotNull(request); |
18 request.on.success.add(expectAsync1(initDb)); | 18 request.on.success.add(expectAsync1(initDb)); |
19 request.on.error.add(fail('open')); | 19 request.on.error.add(fail('open')); |
20 } | 20 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 main() { | 115 main() { |
116 useHtmlConfiguration(); | 116 useHtmlConfiguration(); |
117 | 117 |
118 var test_ = new Test(); | 118 var test_ = new Test(); |
119 test('prepare', test_.start); | 119 test('prepare', test_.start); |
120 test('readAll1', test_.readAllViaCursor); | 120 test('readAll1', test_.readAllViaCursor); |
121 test('readAll2', test_.readAllReversedViaCursor); | 121 test('readAll2', test_.readAllReversedViaCursor); |
122 } | 122 } |
OLD | NEW |