Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: tests/html/serialized_script_value_test.dart

Issue 12036060: Fixing tests after event constructor change. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/history_test.dart ('k') | tests/html/storage_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library SerializedScriptValueTest; 1 library SerializedScriptValueTest;
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: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
9 final event = new MessageEvent('', data:value); 9 // MessageEvent.
10 final event =
11 new MessageEvent('', data: value, origin: '', lastEventId: '');
10 verifyGraph(value, event.data); 12 verifyGraph(value, event.data);
11 }); 13 });
12 14
13 15
14 main() { 16 main() {
15 useHtmlConfiguration(); 17 useHtmlConfiguration();
16 18
17 serializationTest('null', null); 19 serializationTest('null', null);
18 serializationTest('int', 1); 20 serializationTest('int', 1);
19 serializationTest('double', 2.39); 21 serializationTest('double', 2.39);
20 serializationTest('string', 'hey!'); 22 serializationTest('string', 'hey!');
21 23
22 final simpleMap = {'a': 100, 'b': 's'}; 24 final simpleMap = {'a': 100, 'b': 's'};
23 final dagMap = { 'x': simpleMap, 'y': simpleMap }; 25 final dagMap = { 'x': simpleMap, 'y': simpleMap };
24 final cyclicMap = { 'b': dagMap }; 26 final cyclicMap = { 'b': dagMap };
25 cyclicMap['a'] = cyclicMap; 27 cyclicMap['a'] = cyclicMap;
26 serializationTest('simple map', simpleMap); 28 serializationTest('simple map', simpleMap);
27 serializationTest('dag map', dagMap); 29 serializationTest('dag map', dagMap);
28 serializationTest('cyclic map', cyclicMap); 30 serializationTest('cyclic map', cyclicMap);
29 31
30 final simpleList = [ 100, 's']; 32 final simpleList = [ 100, 's'];
31 final dagList = [ simpleList, simpleList ]; 33 final dagList = [ simpleList, simpleList ];
32 final cyclicList = [ dagList ]; 34 final cyclicList = [ dagList ];
33 cyclicList.add(cyclicList); 35 cyclicList.add(cyclicList);
34 serializationTest('simple list', simpleList); 36 serializationTest('simple list', simpleList);
35 serializationTest('dag list', dagList); 37 serializationTest('dag list', dagList);
36 serializationTest('cyclic list', cyclicList); 38 serializationTest('cyclic list', cyclicList);
37 } 39 }
OLDNEW
« no previous file with comments | « tests/html/history_test.dart ('k') | tests/html/storage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698