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

Unified 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: Using generate_tests() 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html b/third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html
new file mode 100644
index 0000000000000000000000000000000000000000..5bc622e0f692a42673d16ddacd2193d450a3b79b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html
@@ -0,0 +1,36 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+var tests = [];
+function test_back_ref(canvas, context, anotherCanvas, message)
+{
+ assert_equals(context.canvas, canvas);
+ context.canvas = anotherCanvas;
+ assert_not_equals(context.canvas, anotherCanvas, message);
+}
+
+// Back reference to html canvas
+var htmlCanvas1 = document.createElement("canvas");
+tests.push(["Test back references to html canvas for CanvasRenderingContext2D",
+ htmlCanvas1, htmlCanvas1.getContext("2d"), document.createElement("canvas"), "ctx2d.canvas is read-only."]);
+
+var htmlCanvas2 = document.createElement("canvas");
+tests.push(["Test back references to html canvas for WebglRenderingContext",
+ htmlCanvas2, htmlCanvas2.getContext("webgl"), document.createElement("canvas"), "webglCtx.canvas is read-only."]);
+
+var htmlCanvas3 = document.createElement("canvas");
+tests.push(["Test back references to canvas for ImageBitmapRenderingContext",
+ htmlCanvas3, htmlCanvas3.getContext("bitmaprenderer"), document.createElement("canvas"), "bitmaprenderer.canvas is read-only."]);
+
+// Back reference to Offscreen canvas
+var offscreenCanvas1 = new OffscreenCanvas(10, 10);
+tests.push(["Test back references to offscreencanvas for OffscreenCanvasRenderingContext2D",
+ offscreenCanvas1, offscreenCanvas1.getContext("2d"), new OffscreenCanvas(10, 10), "ctx2d.canvas is read-only."]);
+
+var offscreenCanvas2 = new OffscreenCanvas(10, 10);
+tests.push(["Test back references to offscreencanvas for WebglRenderingContext",
+ offscreenCanvas2, offscreenCanvas2.getContext("webgl"), new OffscreenCanvas(10, 10), "webgl.canvas is read-only."]);
+
+generate_tests(test_back_ref, tests);
Justin Novosad 2016/08/11 17:37:57 You are not using the test pattern optimally. The
+
+</script>
« 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