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

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

Issue 226903002: tests/html: removed usage of deprecated unittest features (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | tests/html/canvasrenderingcontext2d_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 CanvasTest; 1 library CanvasTest;
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 5
6 main() { 6 main() {
7 CanvasElement canvas; 7 CanvasElement canvas;
8 CanvasRenderingContext2D context; 8 CanvasRenderingContext2D context;
9 int width = 100; 9 int width = 100;
10 int height = 100; 10 int height = 100;
(...skipping 23 matching lines...) Expand all
34 context.fillStyle = 'red'; 34 context.fillStyle = 'red';
35 context.fill(); 35 context.fill();
36 36
37 var url = canvas.toDataUrl(); 37 var url = canvas.toDataUrl();
38 38
39 var img = new ImageElement(); 39 var img = new ImageElement();
40 img.onLoad.listen(expectAsync((_) { 40 img.onLoad.listen(expectAsync((_) {
41 expect(img.complete, true); 41 expect(img.complete, true);
42 })); 42 }));
43 img.onError.listen((_) { 43 img.onError.listen((_) {
44 guardAsync(() { 44 fail('URL failed to load.');
45 expect(true, isFalse, reason: 'URL failed to load.');
46 });
47 }); 45 });
48 img.src = url; 46 img.src = url;
49 }); 47 });
50 } 48 }
51 49
52 void checkPixel(List<int> data, int offset, List<int> rgba) 50 void checkPixel(List<int> data, int offset, List<int> rgba)
53 { 51 {
54 offset *= 4; 52 offset *= 4;
55 for (var i = 0; i < 4; ++i) { 53 for (var i = 0; i < 4; ++i) {
56 expect(data[offset + i], equals(rgba[i])); 54 expect(data[offset + i], equals(rgba[i]));
57 } 55 }
58 } 56 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/canvasrenderingcontext2d_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698