Index: LayoutTests/fast/canvas/script-tests/gradient-addColorStop-with-invalid-offset.js |
diff --git a/LayoutTests/fast/canvas/script-tests/gradient-addColorStop-with-invalid-offset.js b/LayoutTests/fast/canvas/script-tests/gradient-addColorStop-with-invalid-offset.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..493ad9aaccc092e189d4b7c6f8692fcc03727897 |
--- /dev/null |
+++ b/LayoutTests/fast/canvas/script-tests/gradient-addColorStop-with-invalid-offset.js |
@@ -0,0 +1,10 @@ |
+description('This test checks invalid offsets on gradients.'); |
+ |
+var gradient = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 150, 0); |
+ |
+// Check that invalid offset values throw. |
+shouldThrow("gradient.addColorStop(-1, '#000')"); |
+shouldThrow("gradient.addColorStop(2, '#000')"); |
+shouldThrow("gradient.addColorStop(Infinity, '#000')"); |
+shouldThrow("gradient.addColorStop(-Infinity, '#000')"); |
+shouldThrow("gradient.addColorStop(NaN, '#000')"); |