OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'dart:js' as js; | 7 import 'dart:js' as js; |
8 | 8 |
9 import 'package:expect/minitest.dart'; | 9 import 'package:expect/minitest.dart'; |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 }); | 64 }); |
65 | 65 |
66 test('cannot create upgrader for interfaces', () { | 66 test('cannot create upgrader for interfaces', () { |
67 expect(() { | 67 expect(() { |
68 document.createElementUpgrader(HtmlElementInterface); | 68 document.createElementUpgrader(HtmlElementInterface); |
69 }, throws); | 69 }, throws); |
70 }); | 70 }); |
71 | 71 |
72 test('cannot upgrade interfaces', () { | 72 test('cannot upgrade interfaces', () { |
73 expect(() { | 73 expect(() { |
74 upgrader.upgrade(new HtmlElementInterface()); /// compile-time error | 74 upgrader.upgrade(new HtmlElementInterface()); //# compile-time error |
75 }, throws); | 75 }, throws); |
76 }); | 76 }); |
77 | 77 |
78 test('cannot upgrade more than once', () { | 78 test('cannot upgrade more than once', () { |
79 var fooElement = new FooElement(); | 79 var fooElement = new FooElement(); |
80 expect(() { | 80 expect(() { |
81 upgrader.upgrade(fooElement); | 81 upgrader.upgrade(fooElement); |
82 }, throws); | 82 }, throws); |
83 }); | 83 }); |
84 | 84 |
(...skipping 23 matching lines...) Expand all Loading... |
108 }, throws); | 108 }, throws); |
109 }); | 109 }); |
110 | 110 |
111 test('cannot create upgrader for built-in types', () { | 111 test('cannot create upgrader for built-in types', () { |
112 expect(() { | 112 expect(() { |
113 document.createElementUpgrader(HtmlElement); | 113 document.createElementUpgrader(HtmlElement); |
114 }, throws); | 114 }, throws); |
115 }); | 115 }); |
116 } | 116 } |
117 | 117 |
118 class HtmlElementInterface implements HtmlElement { /// compile-time error | 118 class HtmlElementInterface implements HtmlElement { //# compile-time error |
119 HtmlElementInterface.created(); | 119 HtmlElementInterface.created(); |
120 } | 120 } |
121 | 121 |
122 class CustomDiv extends DivElement { | 122 class CustomDiv extends DivElement { |
123 CustomDiv.created() : super.created(); | 123 CustomDiv.created() : super.created(); |
124 } | 124 } |
125 | 125 |
126 class CustomElement extends HtmlElement { | 126 class CustomElement extends HtmlElement { |
127 factory CustomElement() => document.createElement('custom-element'); | 127 factory CustomElement() => document.createElement('custom-element'); |
128 CustomElement.created() : super.created(); | 128 CustomElement.created() : super.created(); |
129 } | 129 } |
OLD | NEW |