Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: tests/html/webgl_1_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
6 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_individual_config.dart'; 8 import 'package:unittest/html_individual_config.dart';
8 import 'dart:html'; 9 import 'dart:html';
9 import 'dart:typed_data'; 10 import 'dart:typed_data';
10 import 'dart:web_gl'; 11 import 'dart:web_gl';
11 import 'dart:web_gl' as gl; 12 import 'dart:web_gl' as gl;
12 13
13 // Test that WebGL is present in dart:web_gl API 14 // Test that WebGL is present in dart:web_gl API
14 15
15 main() { 16 main() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 expect(context, new isInstanceOf<RenderingContext>()); 52 expect(context, new isInstanceOf<RenderingContext>());
52 53
53 context = canvas.getContext3d(depth: false); 54 context = canvas.getContext3d(depth: false);
54 expect(context, isNotNull); 55 expect(context, isNotNull);
55 expect(context, new isInstanceOf<RenderingContext>()); 56 expect(context, new isInstanceOf<RenderingContext>());
56 }); 57 });
57 58
58 test('texImage2D', () { 59 test('texImage2D', () {
59 var canvas = new CanvasElement(); 60 var canvas = new CanvasElement();
60 var context = canvas.getContext3d(); 61 var context = canvas.getContext3d();
61 var pixels = new Uint8List.fromList([0,0,3,255,0,0,0,0,0,0]); 62 var pixels = new Uint8List.fromList([0, 0, 3, 255, 0, 0, 0, 0, 0, 0]);
62 context.texImage2DUntyped(1, 1, 1, 1, 10, 10, 1, 1, pixels); 63 context.texImage2DUntyped(1, 1, 1, 1, 10, 10, 1, 1, pixels);
63 64
64 canvas = new CanvasElement(); 65 canvas = new CanvasElement();
65 document.body.children.add(canvas); 66 document.body.children.add(canvas);
66 var context2 = canvas.getContext('2d'); 67 var context2 = canvas.getContext('2d');
67 context.texImage2DData(1, 1, 1, 1, 10, 68 context.texImage2DData(
68 context2.getImageData(10, 10, 10, 10)); 69 1, 1, 1, 1, 10, context2.getImageData(10, 10, 10, 10));
69 70
70 context.texImage2DImage(1, 1, 1, 1, 10, new ImageElement()); 71 context.texImage2DImage(1, 1, 1, 1, 10, new ImageElement());
71 context.texImage2DCanvas(1, 1, 1, 1, 10, new CanvasElement()); 72 context.texImage2DCanvas(1, 1, 1, 1, 10, new CanvasElement());
72 context.texImage2DVideo(1, 1, 1, 1, 10, new VideoElement()); 73 context.texImage2DVideo(1, 1, 1, 1, 10, new VideoElement());
73 }); 74 });
74 75
75 test('texSubImage2D', () { 76 test('texSubImage2D', () {
76 var canvas = new CanvasElement(); 77 var canvas = new CanvasElement();
77 var context = canvas.getContext3d(); 78 var context = canvas.getContext3d();
78 var pixels = new Uint8List.fromList([0,0,3,255,0,0,0,0,0,0]); 79 var pixels = new Uint8List.fromList([0, 0, 3, 255, 0, 0, 0, 0, 0, 0]);
79 context.texSubImage2DUntyped(1, 1, 1, 1, 10, 10, 1, 1, pixels); 80 context.texSubImage2DUntyped(1, 1, 1, 1, 10, 10, 1, 1, pixels);
80 81
81 canvas = new CanvasElement(); 82 canvas = new CanvasElement();
82 document.body.children.add(canvas); 83 document.body.children.add(canvas);
83 var context2 = canvas.getContext('2d'); 84 var context2 = canvas.getContext('2d');
84 context.texSubImage2DData(1, 1, 1, 1, 1, 10, 85 context.texSubImage2DData(
85 context2.getImageData(10, 10, 10, 10)); 86 1, 1, 1, 1, 1, 10, context2.getImageData(10, 10, 10, 10));
86 87
87 context.texSubImage2DImage(1, 1, 1, 1, 1, 10, new ImageElement()); 88 context.texSubImage2DImage(1, 1, 1, 1, 1, 10, new ImageElement());
88 context.texSubImage2DCanvas(1, 1, 1, 1, 1, 10, new CanvasElement()); 89 context.texSubImage2DCanvas(1, 1, 1, 1, 1, 10, new CanvasElement());
89 context.texSubImage2DVideo(1, 1, 1, 1, 1, 10, new VideoElement()); 90 context.texSubImage2DVideo(1, 1, 1, 1, 1, 10, new VideoElement());
90 }); 91 });
91 92
92 test('getContextAttributes', () { 93 test('getContextAttributes', () {
93 var canvas = new CanvasElement(); 94 var canvas = new CanvasElement();
94 var context = canvas.getContext3d(); 95 var context = canvas.getContext3d();
95 var attributes = context.getContextAttributes(); 96 var attributes = context.getContextAttributes();
96 97
97 expect(attributes, isNotNull); 98 expect(attributes, isNotNull);
98 expect(attributes, new isInstanceOf<gl.ContextAttributes>()); 99 expect(attributes, new isInstanceOf<gl.ContextAttributes>());
99 100
100 expect(attributes.alpha, isBoolean); 101 expect(attributes.alpha, isBoolean);
101 expect(attributes.antialias, isBoolean); 102 expect(attributes.antialias, isBoolean);
102 expect(attributes.depth, isBoolean); 103 expect(attributes.depth, isBoolean);
103 expect(attributes.premultipliedAlpha, isBoolean); 104 expect(attributes.premultipliedAlpha, isBoolean);
104 expect(attributes.preserveDrawingBuffer, isBoolean); 105 expect(attributes.preserveDrawingBuffer, isBoolean);
105 expect(attributes.stencil, isBoolean); 106 expect(attributes.stencil, isBoolean);
106 }); 107 });
107 } 108 }
108 }); 109 });
109 } 110 }
110 111
111 Matcher isBoolean = anyOf(isTrue, isFalse); 112 Matcher isBoolean = anyOf(isTrue, isFalse);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698