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 document_register_type_extensions_test; | 5 library document_register_type_extensions_test; |
6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
7 import 'package:unittest/html_individual_config.dart'; | 7 import 'package:unittest/html_individual_config.dart'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import '../utils.dart'; | 9 import '../utils.dart'; |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 registeredTypes = true; | 95 registeredTypes = true; |
96 document.register(Foo.tag, Foo); | 96 document.register(Foo.tag, Foo); |
97 document.register(Bar.tag, Bar, extendsTag: 'input'); | 97 document.register(Bar.tag, Bar, extendsTag: 'input'); |
98 document.register(Baz.tag, Baz); | 98 document.register(Baz.tag, Baz); |
99 document.register(Qux.tag, Qux, extendsTag: 'input'); | 99 document.register(Qux.tag, Qux, extendsTag: 'input'); |
100 document.register(MyCanvas.tag, MyCanvas, extendsTag: 'canvas'); | 100 document.register(MyCanvas.tag, MyCanvas, extendsTag: 'canvas'); |
101 document.register(CustomCustomDiv.tag, CustomCustomDiv, extendsTag: 'div'); | 101 document.register(CustomCustomDiv.tag, CustomCustomDiv, extendsTag: 'div'); |
102 } | 102 } |
103 | 103 |
104 setUp(loadPolyfills); | 104 setUp(() => customElementsReady); |
105 | 105 |
106 group('registration', () { | 106 group('registration', () { |
107 setUp(registerTypes); | 107 setUp(registerTypes); |
108 | 108 |
109 test('cannot register twice', () { | 109 test('cannot register twice', () { |
110 expect(() => document.register(FooBad.tag, Foo, extendsTag: 'div'), | 110 expect(() => document.register(FooBad.tag, Foo, extendsTag: 'div'), |
111 throws); | 111 throws); |
112 }); | 112 }); |
113 | 113 |
114 test('cannot register for non-matching tag', () { | 114 test('cannot register for non-matching tag', () { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 group('functional', () { | 309 group('functional', () { |
310 setUp(registerTypes); | 310 setUp(registerTypes); |
311 | 311 |
312 test('canvas', () { | 312 test('canvas', () { |
313 var canvas = new MyCanvas(); | 313 var canvas = new MyCanvas(); |
314 canvas.fillAsRed(); | 314 canvas.fillAsRed(); |
315 }); | 315 }); |
316 }); | 316 }); |
317 } | 317 } |
OLD | NEW |