Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 <script> | 3 <script> |
| 4 description("Tests basic functionalities of offscreenCanvas.getContext on the ma in thread"); | 4 description("Tests basic functionalities of offscreenCanvas.getContext on the ma in thread"); |
| 5 | 5 |
| 6 // Tests onstructor of OffscreenCanvas and length/width change | 6 // Tests onstructor of OffscreenCanvas and length/width change |
| 7 var aCanvas = new OffscreenCanvas(40, 60); | 7 var aCanvas = new OffscreenCanvas(40, 60); |
| 8 shouldBe("aCanvas.width", "40"); | 8 shouldBe("aCanvas.width", "40"); |
| 9 shouldBe("aCanvas.height", "60"); | 9 shouldBe("aCanvas.height", "60"); |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 var ctx2 = aCanvas.getContext("webgl"); | 25 var ctx2 = aCanvas.getContext("webgl"); |
| 26 shouldBeNull("ctx2"); | 26 shouldBeNull("ctx2"); |
| 27 | 27 |
| 28 // Calling getContext on the same context type will return the original context type | 28 // Calling getContext on the same context type will return the original context type |
| 29 var ctx3 = aCanvas.getContext("2d"); | 29 var ctx3 = aCanvas.getContext("2d"); |
| 30 shouldBeNonNull("ctx3"); | 30 shouldBeNonNull("ctx3"); |
| 31 shouldBeTrue("ctx3 == ctx"); | 31 shouldBeTrue("ctx3 == ctx"); |
| 32 | 32 |
| 33 // TODO: change the below part of the test when webgl is supported. | 33 // TODO: change the below part of the test when webgl is supported. |
| 34 // Calling getContext on an unimplemented context type will return null | 34 // Calling getContext on an unimplemented context type will return null |
| 35 var bogusCanvas = new OffscreenCanvas(20, 20); | 35 var bCanvas = new OffscreenCanvas(20, 20); |
| 36 var bogusCtx = bogusCanvas.getContext("webgl"); | 36 var ctx4 = bCanvas.getContext("webgl"); |
|
Justin Novosad
2016/04/20 20:07:27
Hmmm... test is called "getContext2D" but it cover
xidachen
2016/04/20 20:52:09
Good catch, this will be changed in a future CL on
| |
| 37 shouldBeNull("bogusCtx"); | 37 shouldBeType("ctx4", "WebGLRenderingContext"); |
| 38 </script> | 38 </script> |
| OLD | NEW |