| 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_individual_config.dart'; | 3 import '../../pkg/unittest/lib/html_individual_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' as idb; | 6 import 'dart:indexed_db' as idb; |
| 7 | 7 |
| 8 const String DB_NAME = 'Test'; | 8 const String DB_NAME = 'Test'; |
| 9 const String STORE_NAME = 'TEST'; | 9 const String STORE_NAME = 'TEST'; |
| 10 const int VERSION = 1; | 10 const int VERSION = 1; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // Test that indexed_db is properly flagged as supported or not. | 115 // Test that indexed_db is properly flagged as supported or not. |
| 116 // Note that the rest of the indexed_db tests assume that this has been | 116 // Note that the rest of the indexed_db tests assume that this has been |
| 117 // checked. | 117 // checked. |
| 118 group('supported', () { | 118 group('supported', () { |
| 119 test('supported', () { | 119 test('supported', () { |
| 120 expect(idb.IdbFactory.supported, true); | 120 expect(idb.IdbFactory.supported, true); |
| 121 }); | 121 }); |
| 122 }); | 122 }); |
| 123 | 123 |
| 124 group('supportsDatabaseNames', () { |
| 125 test('supported', () { |
| 126 expect(html.window.indexedDB.supportsDatabaseNames, isTrue); |
| 127 }); |
| 128 }); |
| 129 |
| 124 group('functional', () { | 130 group('functional', () { |
| 125 test('throws when unsupported', () { | 131 test('throws when unsupported', () { |
| 126 var expectation = idb.IdbFactory.supported ? returnsNormally : throws; | 132 var expectation = idb.IdbFactory.supported ? returnsNormally : throws; |
| 127 | 133 |
| 128 expect(() { | 134 expect(() { |
| 129 var db = html.window.indexedDB; | 135 var db = html.window.indexedDB; |
| 130 db.open('random_db'); | 136 db.open('random_db'); |
| 131 }, expectation); | 137 }, expectation); |
| 132 }); | 138 }); |
| 133 | 139 |
| 134 // Don't bother with these tests if it's unsupported. | 140 // Don't bother with these tests if it's unsupported. |
| 135 if (idb.IdbFactory.supported) { | 141 if (idb.IdbFactory.supported) { |
| 136 test('upgrade', testUpgrade); | 142 test('upgrade', testUpgrade); |
| 137 tests_dynamic(); | 143 tests_dynamic(); |
| 138 tests_typed(); | 144 tests_typed(); |
| 139 } | 145 } |
| 140 }); | 146 }); |
| 141 } | 147 } |
| OLD | NEW |