MCPcopy Index your code
hub / github.com/gpujs/gpu.js / getCanvasTest

Function getCanvasTest

test/features/get-canvas.js:6–36  ·  view source on GitHub ↗
(mode )

Source from the content-addressed store, hash-verified

4describe('get canvas');
5
6function getCanvasTest(mode ) {
7 const gpu = new GPU();
8
9 assert.ok(gpu.context === null, 'context is initially null');
10 assert.ok(gpu.canvas === null, 'canvas is initially null');
11
12 const render = gpu.createKernel(function() {
13 this.color(0, 0, 0, 1);
14 }, {
15 output : [30,30],
16 mode : mode
17 }).setGraphical(true);
18
19 assert.ok(render !== null, 'function generated test');
20 assert.ok(render.canvas, 'testing for canvas after createKernel' );
21 assert.ok(render.context, 'testing for context after createKernel' );
22 assert.ok(gpu.canvas, 'testing for canvas after createKernel' );
23 assert.ok(gpu.context, 'testing for context after createKernel' );
24
25 render();
26
27 assert.ok(render.canvas, 'testing for canvas after render' );
28 assert.ok(render.context, 'testing for context after render' );
29 assert.ok(gpu.canvas, 'testing for canvas after render' );
30 assert.ok(gpu.context, 'testing for context after render' );
31
32 assert.equal(render.canvas, gpu.canvas);
33 assert.equal(render.context, gpu.context);
34
35 gpu.destroy();
36}
37
38test('auto', () => {
39 getCanvasTest(null);

Callers 1

get-canvas.jsFile · 0.85

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
setGraphicalMethod · 0.80
colorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…