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

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: Interface listing expected texts 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/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('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..ae5518421c9ae9a6f525906e14e24f1870f67e35
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/rendering-contexts-back-references.html
@@ -0,0 +1,28 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+function make_canvas(type)
+{
+ if (type == "html")
+ return document.createElement("canvas");
+ return new OffscreenCanvas(10, 10);
+}
+
+function test_back_ref(contextType, canvasType)
+{
+ var canvas = make_canvas(canvasType);
+ var ctx = canvas.getContext(contextType);
+ assert_equals(ctx.canvas, canvas, "Back reference to canvas should work.");
+ var anotherCanvas = make_canvas(canvasType);
+ ctx.canvas = anotherCanvas;
+ assert_not_equals(ctx.canvas, anotherCanvas, "Canvas attribute is read only.");
+}
+
+generate_tests(test_back_ref, [
+ ["2d context on html canvas", "2d", "html"],
+ ["webgl context on html canvas", "webgl", "html"],
+ ["bitmaprenderer context on html canvas", "bitmaprenderer", "html"],
+ ["2d context on offscreen canvas", "2d", "offscreen"],
+ ["webgl context on offscreen canvas", "webgl", "offscreen"],
+]);
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698