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

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

Issue 289283002: Add some layout tests about behavior on undefined and null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 7 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 29 matching lines...) Expand all
40 // Execute test. 40 // Execute test.
41 function prepareTestScenario() { 41 function prepareTestScenario() {
42 var path = new Path2D(); 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(undefined)");
50 shouldThrow("ctx.stroke([])"); 51 shouldThrow("ctx.stroke([])");
51 shouldThrow("ctx.stroke({})"); 52 shouldThrow("ctx.stroke({})");
52 } 53 }
53 54
54 // Run test and allow variation of results. 55 // Run test and allow variation of results.
55 prepareTestScenario(); 56 prepareTestScenario();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698