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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/gradient-addColorStop-with-invalid-offset.js

Issue 268443003: Make CanvasGradient.addColorStop throw TypeError for non-finite offsets (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 description('This test checks invalid offsets on gradients.');
2
3 var gradient = document.createElement('canvas').getContext('2d').createLinearGra dient(0, 0, 150, 0);
4
5 // Check that invalid offset values throw.
6 shouldThrow("gradient.addColorStop(-1, '#000')");
7 shouldThrow("gradient.addColorStop(2, '#000')");
8 shouldThrow("gradient.addColorStop(Infinity, '#000')");
9 shouldThrow("gradient.addColorStop(-Infinity, '#000')");
10 shouldThrow("gradient.addColorStop(NaN, '#000')");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698