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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-path-context-clip.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 clip() works with path and winding rule p arameters."); 1 description("Series of tests to ensure clip() works with path and winding rule p arameters.");
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(50, 50, 1, 1).data; 6 return ctx.getImageData(50, 50, 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 for (var i = 0; i < fillRules.length; i++) { 61 for (var i = 0; i < fillRules.length; i++) {
62 testClipWith(fillRules[i]); 62 testClipWith(fillRules[i]);
63 testClipWith(fillRules[i], path); 63 testClipWith(fillRules[i], path);
64 } 64 }
65 65
66 // Test exception cases. 66 // Test exception cases.
67 shouldThrow("ctx.clip(null)"); 67 shouldThrow("ctx.clip(null)");
68 shouldThrow("ctx.clip(null, null)"); 68 shouldThrow("ctx.clip(null, null)");
69 shouldThrow("ctx.clip(null, 'nonzero')"); 69 shouldThrow("ctx.clip(null, 'nonzero')");
70 shouldThrow("ctx.clip(path, null)");
70 shouldThrow("ctx.clip([], 'nonzero')"); 71 shouldThrow("ctx.clip([], 'nonzero')");
71 shouldThrow("ctx.clip({}, 'nonzero')"); 72 shouldThrow("ctx.clip({}, 'nonzero')");
72 shouldThrow("ctx.clip(null, 'evenodd')"); 73 shouldThrow("ctx.clip(null, 'evenodd')");
73 shouldThrow("ctx.clip([], 'evenodd')"); 74 shouldThrow("ctx.clip([], 'evenodd')");
74 shouldThrow("ctx.clip({}, 'evenodd')"); 75 shouldThrow("ctx.clip({}, 'evenodd')");
75 shouldThrow("ctx.clip('gazonk')"); 76 shouldThrow("ctx.clip('gazonk')");
76 shouldThrow("ctx.clip(path, 'gazonk')"); 77 shouldThrow("ctx.clip(path, 'gazonk')");
78 shouldThrow("ctx.clip(undefined)");
79 shouldThrow("ctx.clip(undefined, undefined)");
80 shouldThrow("ctx.clip(undefined, 'nonzero')");
81 shouldThrow("ctx.clip(path, undefined)");
77 } 82 }
78 83
79 // Run test and allow variation of results. 84 // Run test and allow variation of results.
80 prepareTestScenario(); 85 prepareTestScenario();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698