| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library web_gl_test; | 5 library web_gl_test; |
| 6 | 6 |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 import 'package:unittest/html_individual_config.dart'; | 8 import 'package:unittest/html_individual_config.dart'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:typed_data'; | 10 import 'dart:typed_data'; |
| 11 import 'dart:web_gl'; | 11 import 'dart:web_gl'; |
| 12 import 'dart:web_gl' as gl; | 12 import 'dart:web_gl' as gl; |
| 13 | 13 |
| 14 // Test that various webgl extensions are available. Only test advertised | 14 // Test that various webgl extensions are available. Only test advertised |
| 15 // supported extensions. If the extension has methods, we just test the presence | 15 // supported extensions. If the extension has methods, we just test the presence |
| 16 // of some methods - we don't test if functionality works. | 16 // of some methods - we don't test if functionality works. |
| 17 | 17 |
| 18 main() { | 18 main() { |
| 19 useHtmlIndividualConfiguration(); | 19 useHtmlIndividualConfiguration(); |
| 20 | 20 |
| 21 if (!RenderingContext.supported) return; | 21 if (!RenderingContext.supported) return; |
| 22 | 22 |
| 23 | |
| 24 const allExtensions = const [ | 23 const allExtensions = const [ |
| 25 'ANGLE_instanced_arrays', | 24 'ANGLE_instanced_arrays', |
| 26 'EXT_blend_minmax', | 25 'EXT_blend_minmax', |
| 27 'EXT_color_buffer_float', | 26 'EXT_color_buffer_float', |
| 28 'EXT_color_buffer_half_float', | 27 'EXT_color_buffer_half_float', |
| 29 'EXT_disjoint_timer_query', | 28 'EXT_disjoint_timer_query', |
| 30 'EXT_frag_depth', | 29 'EXT_frag_depth', |
| 31 'EXT_sRGB', | 30 'EXT_sRGB', |
| 32 'EXT_shader_texture_lod', | 31 'EXT_shader_texture_lod', |
| 33 'EXT_texture_filter_anisotropic', | 32 'EXT_texture_filter_anisotropic', |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 testType(name, const isInstanceOf<LoseContext>()); | 189 testType(name, const isInstanceOf<LoseContext>()); |
| 191 test('loseContext', () { | 190 test('loseContext', () { |
| 192 var extension = getExtension(name); | 191 var extension = getExtension(name); |
| 193 if (extension == null) return; | 192 if (extension == null) return; |
| 194 expect(extension.loseContext, isFunction); | 193 expect(extension.loseContext, isFunction); |
| 195 }); | 194 }); |
| 196 }); | 195 }); |
| 197 } | 196 } |
| 198 | 197 |
| 199 Matcher isFunction = const isInstanceOf<Function>(); | 198 Matcher isFunction = const isInstanceOf<Function>(); |
| OLD | NEW |