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

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: 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 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 var tests = [];
5 function test_back_ref(canvas, context, anotherCanvas, message)
6 {
7 assert_equals(context.canvas, canvas);
8 context.canvas = anotherCanvas;
9 assert_not_equals(context.canvas, anotherCanvas, message);
10 }
11
12 // Back reference to html canvas
13 var htmlCanvas1 = document.createElement("canvas");
14 tests.push(["Test back references to html canvas for CanvasRenderingContext2D",
15 htmlCanvas1, htmlCanvas1.getContext("2d"), document.createElement("canva s"), "ctx2d.canvas is read-only."]);
16
17 var htmlCanvas2 = document.createElement("canvas");
18 tests.push(["Test back references to html canvas for WebglRenderingContext",
19 htmlCanvas2, htmlCanvas2.getContext("webgl"), document.createElement("ca nvas"), "webglCtx.canvas is read-only."]);
20
21 var htmlCanvas3 = document.createElement("canvas");
22 tests.push(["Test back references to canvas for ImageBitmapRenderingContext",
23 htmlCanvas3, htmlCanvas3.getContext("bitmaprenderer"), document.createEl ement("canvas"), "bitmaprenderer.canvas is read-only."]);
24
25 // Back reference to Offscreen canvas
26 var offscreenCanvas1 = new OffscreenCanvas(10, 10);
27 tests.push(["Test back references to offscreencanvas for OffscreenCanvasRenderin gContext2D",
28 offscreenCanvas1, offscreenCanvas1.getContext("2d"), new OffscreenCanvas (10, 10), "ctx2d.canvas is read-only."]);
29
30 var offscreenCanvas2 = new OffscreenCanvas(10, 10);
31 tests.push(["Test back references to offscreencanvas for WebglRenderingContext",
32 offscreenCanvas2, offscreenCanvas2.getContext("webgl"), new OffscreenCan vas(10, 10), "webgl.canvas is read-only."]);
33
34 generate_tests(test_back_ref, tests);
Justin Novosad 2016/08/11 17:37:57 You are not using the test pattern optimally. The
35
36 </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