| 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 attribute_changed_callback_test; | 5 library attribute_changed_callback_test; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:js' as js; | 8 import 'dart:js' as js; |
| 9 import 'package:unittest/html_individual_config.dart'; | 9 import 'package:unittest/html_individual_config.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 main() { | 46 main() { |
| 47 useHtmlIndividualConfiguration(); | 47 useHtmlIndividualConfiguration(); |
| 48 | 48 |
| 49 // Adapted from Blink's fast/dom/custom/attribute-changed-callback test. | 49 // Adapted from Blink's fast/dom/custom/attribute-changed-callback test. |
| 50 | 50 |
| 51 var registered = false; | 51 var registered = false; |
| 52 setUp(() => customElementsReady.then((_) { | 52 setUp(() => customElementsReady.then((_) { |
| 53 if (!registered) { | 53 if (!registered) { |
| 54 registered = true; | 54 registered = true; |
| 55 document.register(A.tag, A); | 55 document.registerElement(A.tag, A); |
| 56 document.register(B.tag, B); | 56 document.registerElement(B.tag, B); |
| 57 } | 57 } |
| 58 })); | 58 })); |
| 59 | 59 |
| 60 group('fully_supported', () { | 60 group('fully_supported', () { |
| 61 test('transfer attribute changed callback', () { | 61 test('transfer attribute changed callback', () { |
| 62 var element = new A(); | 62 var element = new A(); |
| 63 | 63 |
| 64 element.attributes['a'] = 'b'; | 64 element.attributes['a'] = 'b'; |
| 65 expect(A.attributeChangedInvocations, 1); | 65 expect(A.attributeChangedInvocations, 1); |
| 66 }); | 66 }); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 test('add, change classes', () { | 102 test('add, change classes', () { |
| 103 var b = new B(); | 103 var b = new B(); |
| 104 | 104 |
| 105 B.invocations = []; | 105 B.invocations = []; |
| 106 b.classes.toggle('u'); | 106 b.classes.toggle('u'); |
| 107 expect(B.invocations, ['class: null => u']); | 107 expect(B.invocations, ['class: null => u']); |
| 108 }); | 108 }); |
| 109 }); | 109 }); |
| 110 } | 110 } |
| OLD | NEW |