Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <script src="../../resources/testharness.js"></script> | |
| 2 <script src="../../resources/testharnessreport.js"></script> | |
| 3 <script> | |
| 4 function generateTest(canvas, context, anotherCanvas, message) | |
|
Justin Novosad
2016/08/10 18:56:33
I meant use "generate_tests" from testharness.js i
xlai (Olivia)
2016/08/10 20:51:29
Done.
| |
| 5 { | |
| 6 assert_equals(context.canvas, canvas); | |
| 7 context.canvas = anotherCanvas; | |
| 8 assert_not_equals(context.canvas, anotherCanvas, message); | |
| 9 } | |
| 10 | |
| 11 // Back reference to html canvas | |
| 12 test(function() { | |
| 13 var htmlCanvas = document.createElement("canvas"); | |
| 14 generateTest(htmlCanvas, htmlCanvas.getContext("2d"), document.createElement ("canvas"), "ctx2d.canvas is read-only."); | |
| 15 }, "Test back references to html canvas for CanvasRenderingContext2D"); | |
| 16 | |
| 17 test(function() { | |
| 18 var htmlCanvas = document.createElement("canvas"); | |
| 19 generateTest(htmlCanvas, htmlCanvas.getContext("webgl"), document.createElem ent("canvas"), "webglCtx.canvas is read-only."); | |
| 20 }, "back references to html canvas for WebglRenderingContext"); | |
| 21 | |
| 22 test(function() { | |
| 23 var htmlCanvas = document.createElement("canvas"); | |
| 24 generateTest(htmlCanvas, htmlCanvas.getContext("bitmaprenderer"), document.c reateElement("canvas"), "bitmaprenderer.canvas is read-only."); | |
| 25 }, "back references to canvas for ImageBitmapRenderingContext"); | |
| 26 | |
| 27 // Back reference to Offscreen canvas | |
| 28 test(function() { | |
| 29 var offscreenCanvas = new OffscreenCanvas(10, 10); | |
| 30 generateTest(offscreenCanvas, offscreenCanvas.getContext("2d"), new Offscree nCanvas(10, 10), "ctx2d.canvas is read-only."); | |
| 31 }, "back references to offscreencanvas for OffscreenCanvasRenderingContext2D"); | |
| 32 | |
| 33 test(function() { | |
| 34 var offscreenCanvas = new OffscreenCanvas(10, 10); | |
| 35 generateTest(offscreenCanvas, offscreenCanvas.getContext("webgl"), new Offsc reenCanvas(10, 10), "webgl.canvas is read-only."); | |
| 36 }, "back references to offscreencanvas for WebglRenderingContext"); | |
| 37 | |
| 38 </script> | |
| OLD | NEW |