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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-path-context-stroke.js

Issue 178673002: Rename Path to Path2D (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@path
Patch Set: Merge to head which includes isPoint and addPath changes. Created 6 years, 9 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
OLDNEW
1 description("Series of tests to ensure stroke() works with optional path paramet er."); 1 description("Series of tests to ensure stroke() works with optional path paramet er.");
2 2
3 var ctx = document.getElementById('canvas').getContext('2d'); 3 var ctx = document.getElementById('canvas').getContext('2d');
4 4
5 function pixelDataAtPoint() { 5 function pixelDataAtPoint() {
6 return ctx.getImageData(75, 75, 1, 1).data; 6 return ctx.getImageData(75, 75, 1, 1).data;
7 } 7 }
8 8
9 function checkResult(expectedColors, sigma) { 9 function checkResult(expectedColors, sigma) {
10 for (var i = 0; i < 4; i++) 10 for (var i = 0; i < 4; i++)
(...skipping 21 matching lines...) Expand all
32 ctx.beginPath(); 32 ctx.beginPath();
33 drawRectangleOn(ctx); 33 drawRectangleOn(ctx);
34 ctx.stroke(); 34 ctx.stroke();
35 } 35 }
36 debug(''); 36 debug('');
37 checkResult([0, 255, 0, 255], 5); 37 checkResult([0, 255, 0, 255], 5);
38 } 38 }
39 39
40 // Execute test. 40 // Execute test.
41 function prepareTestScenario() { 41 function prepareTestScenario() {
42 var path = new Path(); 42 var path = new Path2D();
43 drawRectangleOn(path); 43 drawRectangleOn(path);
44 44
45 testStrokeWith(); 45 testStrokeWith();
46 testStrokeWith(path); 46 testStrokeWith(path);
47 47
48 // Test exception cases. 48 // Test exception cases.
49 shouldThrow("ctx.stroke(null)"); 49 shouldThrow("ctx.stroke(null)");
50 shouldThrow("ctx.stroke([])"); 50 shouldThrow("ctx.stroke([])");
51 shouldThrow("ctx.stroke({})"); 51 shouldThrow("ctx.stroke({})");
52 } 52 }
53 53
54 // Run test and allow variation of results. 54 // Run test and allow variation of results.
55 prepareTestScenario(); 55 prepareTestScenario();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698