OLD | NEW |
(Empty) | |
| 1 <sky> |
| 2 <script> |
| 3 import "../resources/third_party/unittest/unittest.dart"; |
| 4 import "../resources/unit.dart"; |
| 5 |
| 6 import "dart:sky"; |
| 7 |
| 8 class CustomText extends Text { |
| 9 CustomText() : super("awesome"); |
| 10 |
| 11 bool get isCustom => true; |
| 12 } |
| 13 |
| 14 void main() { |
| 15 initUnit(); |
| 16 |
| 17 test("should be able to insert in DOM", () { |
| 18 var child = new CustomText(); |
| 19 expect(child.isCustom, isTrue); |
| 20 expect(child.parentNode, isNull); |
| 21 expect(child.data, equals("awesome")); |
| 22 |
| 23 var parent = document.createElement("div"); |
| 24 parent.appendChild(child); |
| 25 expect(child.parentNode, equals(parent)); |
| 26 expect(parent.firstChild, equals(child)); |
| 27 expect(parent.firstChild.isCustom, isTrue); |
| 28 }); |
| 29 } |
| 30 </script> |
| 31 </sky> |
OLD | NEW |