Index: third_party/WebKit/LayoutTests/fast/canvas/OffScreenCanvas-invalid-args.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffScreenCanvas-invalid-args.html b/third_party/WebKit/LayoutTests/fast/canvas/OffScreenCanvas-invalid-args.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..47622124fb559894f98403941a6918a2db94aa2a |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffScreenCanvas-invalid-args.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+description("Tests that the OffScreenCanvas can handle invalid arguments"); |
+ |
+// Since blink uses signed int internally, this case tests how the constructor |
+// responses to the arguments that are larger than INT_MAX which would cause |
Justin Novosad
2015/12/03 19:06:11
responses -> responds
xidachen
2015/12/03 20:42:22
Done.
|
+// overflow. |
Justin Novosad
2015/12/03 19:06:11
Add: the current implementation is expected to cla
xidachen
2015/12/03 20:42:22
Done.
|
+var setWidth = Math.pow(2, 31); |
+var setHeight = Math.pow(2, 31); |
+var canvas1 = new OffScreenCanvas(setWidth, setHeight); |
+ |
+shouldBe("canvas1.width", "setWidth-1"); |
+shouldBe("canvas1.height", "setHeight-1"); |
+ |
+var canvas2 = new OffScreenCanvas(-1, -1); |
+shouldBe("canvas2.width", "setWidth-1"); |
Justin Novosad
2015/12/03 19:06:11
This looks like a bug to me. The WebIDL spec says
xidachen
2015/12/03 20:42:22
The WebIDL: http://www.w3.org/TR/WebIDL/#es-unsign
|
+shouldBe("canvas2.height", "setHeight-1"); |
+ |
+var canvas3 = new OffScreenCanvas(null, null); |
+shouldBe("canvas3.width", "0"); |
+shouldBe("canvas3.height", "0"); |
+ |
+var obj = {Name: "John Doe", Age: 30}; |
+var canvas4 = new OffScreenCanvas(obj, obj); |
+shouldBe("canvas4.width", "0"); |
+shouldBe("canvas4.height", "0"); |
+</script> |
Justin Novosad
2015/12/03 19:06:11
still missing test coverage for assigning invalid
xidachen
2015/12/03 20:42:22
Done.
|