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

Side by Side Diff: client/tests/client/dom/CanvasUsingHtmlTest.dart

Issue 10037027: unittest step2: bye bye to multiple entrypoints for unittest (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 | « client/tests/client/dom/CanvasTest.dart ('k') | client/tests/client/dom/CrossFrameTest.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('CanvasUsingHtmlTest'); 1 #library('CanvasUsingHtmlTest');
2 #import('../../../../lib/unittest/unittest_dom.dart'); 2 #import('../../../../lib/unittest/unittest.dart');
3 #import('../../../../lib/unittest/dom_config.dart');
3 #import('dart:html', prefix: 'html'); 4 #import('dart:html', prefix: 'html');
4 #import('dart:dom'); 5 #import('dart:dom');
5 6
6 // Version of Canvas test that implicitly uses dart:html library via unittests. 7 // Version of Canvas test that implicitly uses dart:html library via unittests.
7 8
8 main() { 9 main() {
9 HTMLCanvasElement canvas; 10 HTMLCanvasElement canvas;
10 CanvasRenderingContext2D context; 11 CanvasRenderingContext2D context;
11 12
12 canvas = document.createElement('canvas'); 13 canvas = document.createElement('canvas');
13 canvas.setAttribute('width', '100'); 14 canvas.setAttribute('width', '100');
14 canvas.setAttribute('height', '100'); 15 canvas.setAttribute('height', '100');
15 document.body.appendChild(canvas); 16 document.body.appendChild(canvas);
16 context = canvas.getContext('2d'); 17 context = canvas.getContext('2d');
17 18
18 forLayoutTests(); 19 useDomConfiguration();
19 test('FillStyle', () { 20 test('FillStyle', () {
20 context.fillStyle = "red"; 21 context.fillStyle = "red";
21 context.fillRect(10, 10, 20, 20); 22 context.fillRect(10, 10, 20, 20);
22 23
23 // TODO(vsm): Verify the result once we have the ability to read pixels. 24 // TODO(vsm): Verify the result once we have the ability to read pixels.
24 }); 25 });
25 test('SetFillColor', () { 26 test('SetFillColor', () {
26 // With floats. 27 // With floats.
27 context.setFillColor(10, 10, 10, 10); 28 context.setFillColor(10, 10, 10, 10);
28 context.fillRect(10, 10, 20, 20); 29 context.fillRect(10, 10, 20, 20);
(...skipping 18 matching lines...) Expand all
47 ImageData image = context.createImageData(canvas.width, 48 ImageData image = context.createImageData(canvas.width,
48 canvas.height); 49 canvas.height);
49 CanvasPixelArray bytes = image.data; 50 CanvasPixelArray bytes = image.data;
50 51
51 // FIXME: uncomment when numeric index getters are supported. 52 // FIXME: uncomment when numeric index getters are supported.
52 //var byte = bytes[0]; 53 //var byte = bytes[0];
53 54
54 Expect.equals(40000, bytes.length); 55 Expect.equals(40000, bytes.length);
55 }); 56 });
56 } 57 }
OLDNEW
« no previous file with comments | « client/tests/client/dom/CanvasTest.dart ('k') | client/tests/client/dom/CrossFrameTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698