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

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: 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 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..b6a3538e492819a6606e6510f6cd5a447883b985
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html
@@ -0,0 +1,38 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+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.
+{
+ assert_equals(context.canvas, canvas);
+ context.canvas = anotherCanvas;
+ assert_not_equals(context.canvas, anotherCanvas, message);
+}
+
+// Back reference to html canvas
+test(function() {
+ var htmlCanvas = document.createElement("canvas");
+ generateTest(htmlCanvas, htmlCanvas.getContext("2d"), document.createElement("canvas"), "ctx2d.canvas is read-only.");
+}, "Test back references to html canvas for CanvasRenderingContext2D");
+
+test(function() {
+ var htmlCanvas = document.createElement("canvas");
+ generateTest(htmlCanvas, htmlCanvas.getContext("webgl"), document.createElement("canvas"), "webglCtx.canvas is read-only.");
+}, "back references to html canvas for WebglRenderingContext");
+
+test(function() {
+ var htmlCanvas = document.createElement("canvas");
+ generateTest(htmlCanvas, htmlCanvas.getContext("bitmaprenderer"), document.createElement("canvas"), "bitmaprenderer.canvas is read-only.");
+}, "back references to canvas for ImageBitmapRenderingContext");
+
+// Back reference to Offscreen canvas
+test(function() {
+ var offscreenCanvas = new OffscreenCanvas(10, 10);
+ generateTest(offscreenCanvas, offscreenCanvas.getContext("2d"), new OffscreenCanvas(10, 10), "ctx2d.canvas is read-only.");
+}, "back references to offscreencanvas for OffscreenCanvasRenderingContext2D");
+
+test(function() {
+ var offscreenCanvas = new OffscreenCanvas(10, 10);
+ generateTest(offscreenCanvas, offscreenCanvas.getContext("webgl"), new OffscreenCanvas(10, 10), "webgl.canvas is read-only.");
+}, "back references to offscreencanvas for WebglRenderingContext");
+
+</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