OLD | NEW |
1 #library('SerializedScriptValueTest'); | 1 #library('SerializedScriptValueTest'); |
2 #import('../../lib/unittest/unittest.dart'); | 2 #import('../../pkg/unittest/unittest.dart'); |
3 #import('../../lib/unittest/html_config.dart'); | 3 #import('../../pkg/unittest/html_config.dart'); |
4 #import('dart:html'); | 4 #import('dart:html'); |
5 #import('utils.dart'); | 5 #import('utils.dart'); |
6 | 6 |
7 serializationTest(name, value) => test(name, () { | 7 serializationTest(name, value) => test(name, () { |
8 // To check how value is serialized and deserialized, we create a MessageE
vent. | 8 // To check how value is serialized and deserialized, we create a MessageE
vent. |
9 final event = document.$dom_createEvent('MessageEvent'); | 9 final event = document.$dom_createEvent('MessageEvent'); |
10 event.initMessageEvent('', false, false, value, '', '', window, []); | 10 event.initMessageEvent('', false, false, value, '', '', window, []); |
11 verifyGraph(value, event.data); | 11 verifyGraph(value, event.data); |
12 }); | 12 }); |
13 | 13 |
(...skipping 15 matching lines...) Expand all Loading... |
29 serializationTest('cyclic map', cyclicMap); | 29 serializationTest('cyclic map', cyclicMap); |
30 | 30 |
31 final simpleList = [ 100, 's']; | 31 final simpleList = [ 100, 's']; |
32 final dagList = [ simpleList, simpleList ]; | 32 final dagList = [ simpleList, simpleList ]; |
33 final cyclicList = [ dagList ]; | 33 final cyclicList = [ dagList ]; |
34 cyclicList.add(cyclicList); | 34 cyclicList.add(cyclicList); |
35 serializationTest('simple list', simpleList); | 35 serializationTest('simple list', simpleList); |
36 serializationTest('dag list', dagList); | 36 serializationTest('dag list', dagList); |
37 serializationTest('cyclic list', cyclicList); | 37 serializationTest('cyclic list', cyclicList); |
38 } | 38 } |
OLD | NEW |