-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathWebGLAnimation.spec.ts
More file actions
39 lines (32 loc) · 1.35 KB
/
WebGLAnimation.spec.ts
File metadata and controls
39 lines (32 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @author Kara Rawson / rawsonkara@gmail.com
*/
import { WebGLAnimation } from './WebGLAnimation'
import { WebGLRenderingContext } from "../WebGLRenderingContext";
import { WebGL2RenderingContext } from "../WebGL2RenderingContext";
/**
* @todo make sure we test the WebGLAnimationFrame
*/
describe('Renderers', () => {
describe('WebGL', () => {
describe('WebGLAnimation', () => {
todo('start')
todo('stop')
todo('setAnimationLoop')
todo('WebGlAnimationFrame_callback')
test('setContext', (): void => {
var animation = new WebGLAnimation()
var gl: WebGLRenderingContext = new WebGLRenderingContext()
var gl2: WebGL2RenderingContext = new WebGL2RenderingContext()
animation.setContext(gl, null)
expect(animation.context).not.toBeNull("WebGLRenderingContext should not be null")
expect(animation.context2).toBeNull("WebGL2RenderingContext should be null")
expect(animation.context).toStrictEqual(gl, "WebGLRenderingContext should be type gl")
animation.setContext(null, gl2)
expect(animation.context).toBeNull("WebGLRenderingContext should be null")
expect(animation.context2).not.toBeNull("WebGL2RenderingContext should not be null")
expect(animation.context2).toStrictEqual(gl2, "WebGLRenderingContext should be type gl2")
})
})
})
})