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

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

Issue 10178014: Copy lib/dom tests that use dart:html to lib/html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 8 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/dom/request_animation_frame_test.dart ('k') | tests/dom/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
(Empty)
1 #library('SerializedScriptValueTest');
2 #import('../../lib/unittest/unittest.dart');
3 #import('../../lib/unittest/html_config.dart');
4 #import('dart:html');
5 #import('utils.dart');
6
7 serializationTest(name, value) => test(name, () {
8 // To check how value is serialized and deserialized, we create a MessageE vent.
9 final event = document.$dom_createEvent('MessageEvent');
10 event.initMessageEvent('', false, false, value, '', '', window, []);
11 verifyGraph(value, event.data);
12 });
13
14
15 main() {
16 useHtmlConfiguration();
17
18 serializationTest('null', null);
19 serializationTest('int', 1);
20 serializationTest('double', 2.39);
21 serializationTest('string', 'hey!');
22
23 final simpleMap = {'a': 100, 'b': 's'};
24 final dagMap = { 'x': simpleMap, 'y': simpleMap };
25 final cyclicMap = { 'b': dagMap };
26 cyclicMap['a'] = cyclicMap;
27 serializationTest('simple map', simpleMap);
28 serializationTest('dag map', dagMap);
29 serializationTest('cyclic map', cyclicMap);
30
31 final simpleList = [ 100, 's'];
32 final dagList = [ simpleList, simpleList ];
33 final cyclicList = [ dagList ];
34 cyclicList.add(cyclicList);
35 serializationTest('simple list', simpleList);
36 serializationTest('dag list', dagList);
37 serializationTest('cyclic list', cyclicList);
38 }
OLDNEW
« no previous file with comments | « tests/dom/request_animation_frame_test.dart ('k') | tests/dom/storage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698