| 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 custom_elements_test; | 5 library custom_elements_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 | 9 |
| 10 class CustomType extends Element { | 10 class CustomType extends Element { |
| 11 factory CustomType() => null; |
| 12 |
| 11 bool onCreatedCalled = false; | 13 bool onCreatedCalled = false; |
| 12 void onCreated() { | 14 void onCreated() { |
| 13 onCreatedCalled = true; | 15 onCreatedCalled = true; |
| 14 } | 16 } |
| 15 } | 17 } |
| 16 | 18 |
| 17 class NotAnElement {} | 19 class NotAnElement {} |
| 18 | 20 |
| 19 main() { | 21 main() { |
| 20 useHtmlIndividualConfiguration(); | 22 useHtmlIndividualConfiguration(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 postElement.onFocus.listen((_) { | 91 postElement.onFocus.listen((_) { |
| 90 firedOnPost = true; | 92 firedOnPost = true; |
| 91 }); | 93 }); |
| 92 // Event handlers should not persist to new element. | 94 // Event handlers should not persist to new element. |
| 93 postElement.dispatchEvent(new Event('focus')); | 95 postElement.dispatchEvent(new Event('focus')); |
| 94 expect(firedOnPre, isFalse); | 96 expect(firedOnPre, isFalse); |
| 95 expect(firedOnPost, isTrue); | 97 expect(firedOnPost, isTrue); |
| 96 }); | 98 }); |
| 97 }); | 99 }); |
| 98 } | 100 } |
| OLD | NEW |