OLD | NEW |
1 #library('WebGL1Test'); | 1 #library('WebGL1Test'); |
2 #import('../../../../lib/unittest/unittest.dart'); | 2 #import('../../lib/unittest/unittest.dart'); |
3 #import('../../../../lib/unittest/dom_config.dart'); | 3 #import('../../lib/unittest/dom_config.dart'); |
4 #import('dart:dom'); | 4 #import('dart:dom'); |
5 | 5 |
6 // Test that WebGL is present in dart:dom API | 6 // Test that WebGL is present in dart:dom API |
7 | 7 |
8 main() { | 8 main() { |
9 useDomConfiguration(); | 9 useDomConfiguration(); |
10 | 10 |
11 test('simple', () { | 11 test('simple', () { |
12 var canvas = document.createElement("canvas"); | 12 var canvas = document.createElement("canvas"); |
13 var gl = canvas.getContext("experimental-webgl"); | 13 var gl = canvas.getContext("experimental-webgl"); |
14 var shader = gl.createShader(WebGLRenderingContext.VERTEX_SHADER); | 14 var shader = gl.createShader(WebGLRenderingContext.VERTEX_SHADER); |
15 gl.shaderSource(shader, "void main() { }"); | 15 gl.shaderSource(shader, "void main() { }"); |
16 gl.compileShader(shader); | 16 gl.compileShader(shader); |
17 var success = | 17 var success = |
18 gl.getShaderParameter(shader, WebGLRenderingContext.COMPILE_STATUS); | 18 gl.getShaderParameter(shader, WebGLRenderingContext.COMPILE_STATUS); |
19 Expect.isTrue(success); | 19 Expect.isTrue(success); |
20 }); | 20 }); |
21 } | 21 } |
OLD | NEW |