| 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:math' as math; | 6 import 'dart:math' as math; |
| 7 import 'dart:indexed_db' as idb; | 7 import 'dart:indexed_db' as idb; |
| 8 | 8 |
| 9 const String STORE_NAME = 'TEST'; | 9 const String STORE_NAME = 'TEST'; |
| 10 const int VERSION = 1; | 10 const int VERSION = 1; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void testTypes(testFunction) { | 122 void testTypes(testFunction) { |
| 123 test('String', testFunction(123, 'Hoot!', equals('Hoot!'))); | 123 test('String', testFunction(123, 'Hoot!', equals('Hoot!'))); |
| 124 test('int', testFunction(123, 12345, equals(12345))); | 124 test('int', testFunction(123, 12345, equals(12345))); |
| 125 test('List', testFunction(123, [1, 2, 3], equals([1, 2, 3]))); | 125 test('List', testFunction(123, [1, 2, 3], equals([1, 2, 3]))); |
| 126 test('List 2', testFunction(123, [2, 3, 4], equals([2, 3, 4]))); | 126 test('List 2', testFunction(123, [2, 3, 4], equals([2, 3, 4]))); |
| 127 test('bool', testFunction(123, [true, false], equals([true, false]))); | 127 test('bool', testFunction(123, [true, false], equals([true, false]))); |
| 128 test('largeInt', testFunction(123, 1371854424211, | 128 test('largeInt', testFunction(123, 1371854424211, |
| 129 equals("1371854424211"), null, STORE_NAME, VERSION, true)); | 129 equals("1371854424211"), null, STORE_NAME, VERSION, true)); |
| 130 test('largeDoubleConvertedToInt', testFunction(123, 1371854424211.0, | 130 test('largeDoubleConvertedToInt', testFunction(123, 1371854424211.0, |
| 131 equals("1371854424211"), null, STORE_NAME, VERSION, true)); | 131 equals("1371854424211"), null, STORE_NAME, VERSION, true)); |
| 132 // TODO(efortuna): Investigate. | |
| 133 //test('double', testFunction(123, math.pow(2, 53), | |
| 134 // equals("9007199254740992.0"), null, STORE_NAME, VERSION, true)); | |
| 135 test('largeIntInMap', testFunction(123, {'time': 4503599627370492}, | 132 test('largeIntInMap', testFunction(123, {'time': 4503599627370492}, |
| 136 equals("{time: 4503599627370492}"), null, STORE_NAME, VERSION, true)); | 133 equals("{time: 4503599627370492}"), null, STORE_NAME, VERSION, true)); |
| 137 var now = new DateTime.now(); | 134 var now = new DateTime.now(); |
| 138 test('DateTime', testFunction(123, now, | 135 test('DateTime', testFunction(123, now, |
| 139 predicate((date) => | 136 predicate((date) => |
| 140 date.millisecondsSinceEpoch == now.millisecondsSinceEpoch))); | 137 date.millisecondsSinceEpoch == now.millisecondsSinceEpoch))); |
| 141 } | 138 } |
| 142 | 139 |
| 143 main() { | 140 main() { |
| 144 useHtmlIndividualConfiguration(); | 141 useHtmlIndividualConfiguration(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 173 test('upgrade', testUpgrade); | 170 test('upgrade', testUpgrade); |
| 174 group('dynamic', () { | 171 group('dynamic', () { |
| 175 testTypes(testReadWrite); | 172 testTypes(testReadWrite); |
| 176 }); | 173 }); |
| 177 group('typed', () { | 174 group('typed', () { |
| 178 testTypes(testReadWriteTyped); | 175 testTypes(testReadWriteTyped); |
| 179 }); | 176 }); |
| 180 } | 177 } |
| 181 }); | 178 }); |
| 182 } | 179 } |
| OLD | NEW |