Chromium Code Reviews| 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>()); | |
|
sra1
2013/10/23 04:15:44
Also check you can access the fields.
I believe th
Andrei Mouravski
2013/10/24 18:09:49
Done.
| |
| 99 }); | |
| 91 } | 100 } |
| 92 }); | 101 }); |
| 93 } | 102 } |
| 94 | 103 |
| OLD | NEW |