Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/js-test.js"></script> | |
| 3 <script> | |
| 4 description("Tests that the OffScreenCanvas can handle invalid arguments"); | |
| 5 | |
| 6 // Since blink uses signed int internally, this case tests how the constructor | |
| 7 // 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.
| |
| 8 // 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.
| |
| 9 var setWidth = Math.pow(2, 31); | |
| 10 var setHeight = Math.pow(2, 31); | |
| 11 var canvas1 = new OffScreenCanvas(setWidth, setHeight); | |
| 12 | |
| 13 shouldBe("canvas1.width", "setWidth-1"); | |
| 14 shouldBe("canvas1.height", "setHeight-1"); | |
| 15 | |
| 16 var canvas2 = new OffScreenCanvas(-1, -1); | |
| 17 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
| |
| 18 shouldBe("canvas2.height", "setHeight-1"); | |
| 19 | |
| 20 var canvas3 = new OffScreenCanvas(null, null); | |
| 21 shouldBe("canvas3.width", "0"); | |
| 22 shouldBe("canvas3.height", "0"); | |
| 23 | |
| 24 var obj = {Name: "John Doe", Age: 30}; | |
| 25 var canvas4 = new OffScreenCanvas(obj, obj); | |
| 26 shouldBe("canvas4.width", "0"); | |
| 27 shouldBe("canvas4.height", "0"); | |
| 28 </script> | |
|
Justin Novosad
2015/12/03 19:06:11
still missing test coverage for assigning invalid
xidachen
2015/12/03 20:42:22
Done.
| |
| OLD | NEW |