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

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

Issue 21303002: Adding additional tests for serialized script value conversions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « no previous file | tests/html/utils.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 8 // To check how value is serialized and deserialized, we create a
9 // MessageEvent. 9 // MessageEvent.
10 final event = 10 final event =
(...skipping 18 matching lines...) Expand all
29 serializationTest('dag map', dagMap); 29 serializationTest('dag map', dagMap);
30 serializationTest('cyclic map', cyclicMap); 30 serializationTest('cyclic map', cyclicMap);
31 31
32 final simpleList = [ 100, 's']; 32 final simpleList = [ 100, 's'];
33 final dagList = [ simpleList, simpleList ]; 33 final dagList = [ simpleList, simpleList ];
34 final cyclicList = [ dagList ]; 34 final cyclicList = [ dagList ];
35 cyclicList.add(cyclicList); 35 cyclicList.add(cyclicList);
36 serializationTest('simple list', simpleList); 36 serializationTest('simple list', simpleList);
37 serializationTest('dag list', dagList); 37 serializationTest('dag list', dagList);
38 serializationTest('cyclic list', cyclicList); 38 serializationTest('cyclic list', cyclicList);
39
40 serializationTest('datetime', [new DateTime.now()]);
41
42 var blob = new Blob(
43 ['Indescribable... Indestructible! Nothing can stop it!'],
44 'text/plain');
45 serializationTest('blob', [blob]);
46
47 var canvas = new CanvasElement();
48 canvas.width = 100;
49 canvas.height = 100;
50 var imageData = canvas.context2D.getImageData(0, 0, 1, 1);
51 serializationTest('imagedata', [imageData]);
52
53 expect(() {
54 new MessageEvent('', data: new DivElement(), origin: '', lastEventId: '');
55 }, throws);
39 } 56 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698