Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html

Issue 2221173003: Updates on canvas backreference for canvas rendering contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unify Canvas attribute on webgl rendering context Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/generated.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/generated.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698