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

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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <script src="../../resources/testharness.js"></script>
2 <script src="../../resources/testharnessreport.js"></script>
3 <script>
4 function make_canvas(type)
5 {
6 if (type == "html")
7 return document.createElement("canvas");
8 return new OffscreenCanvas(10, 10);
9 }
10
11 function test_back_ref(contextType, canvasType)
12 {
13 var canvas = make_canvas(canvasType);
14 var ctx = canvas.getContext(contextType);
15 assert_equals(ctx.canvas, canvas, "Back reference to canvas should work.");
16 var anotherCanvas = make_canvas(canvasType);
17 ctx.canvas = anotherCanvas;
18 assert_not_equals(ctx.canvas, anotherCanvas, "Canvas attribute is read only. ");
19 }
20
21 generate_tests(test_back_ref, [
22 ["2d context on html canvas", "2d", "html"],
23 ["webgl context on html canvas", "webgl", "html"],
24 ["bitmaprenderer context on html canvas", "bitmaprenderer", "html"],
25 ["2d context on offscreen canvas", "2d", "offscreen"],
26 ["webgl context on offscreen canvas", "webgl", "offscreen"],
27 ]);
28 </script>
OLDNEW
« 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