| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
| 10 import 'dart:web_gl'; | 10 import 'dart:web_gl'; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 canvas = new CanvasElement(); | 81 canvas = new CanvasElement(); |
| 82 document.body.children.add(canvas); | 82 document.body.children.add(canvas); |
| 83 var context2 = canvas.getContext('2d'); | 83 var context2 = canvas.getContext('2d'); |
| 84 context.texSubImage2DData(1, 1, 1, 1, 1, 10, | 84 context.texSubImage2DData(1, 1, 1, 1, 1, 10, |
| 85 context2.getImageData(10, 10, 10, 10)); | 85 context2.getImageData(10, 10, 10, 10)); |
| 86 | 86 |
| 87 context.texSubImage2DImage(1, 1, 1, 1, 1, 10, new ImageElement()); | 87 context.texSubImage2DImage(1, 1, 1, 1, 1, 10, new ImageElement()); |
| 88 context.texSubImage2DCanvas(1, 1, 1, 1, 1, 10, new CanvasElement()); | 88 context.texSubImage2DCanvas(1, 1, 1, 1, 1, 10, new CanvasElement()); |
| 89 context.texSubImage2DVideo(1, 1, 1, 1, 1, 10, new VideoElement()); | 89 context.texSubImage2DVideo(1, 1, 1, 1, 1, 10, new VideoElement()); |
| 90 }); | 90 }); |
| 91 |
| 92 test('getContextAttributes', () { |
| 93 var canvas = new CanvasElement(); |
| 94 var context = canvas.getContext3d(); |
| 95 var attributes = context.getContextAttributes(); |
| 96 |
| 97 expect(attributes, isNotNull); |
| 98 expect(attributes, new isInstanceOf<gl.ContextAttributes>()); |
| 99 |
| 100 expect(attributes.alpha, isBoolean); |
| 101 expect(attributes.antialias, isBoolean); |
| 102 expect(attributes.depth, isBoolean); |
| 103 expect(attributes.premultipliedAlpha, isBoolean); |
| 104 expect(attributes.preserveDrawingBuffer, isBoolean); |
| 105 expect(attributes.stencil, isBoolean); |
| 106 }); |
| 91 } | 107 } |
| 92 }); | 108 }); |
| 93 } | 109 } |
| 94 | 110 |
| 111 Matcher isBoolean = anyOf(isTrue, isFalse); |
| OLD | NEW |