| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 b.attributes['data-v'] = 'x'; | 85 b.attributes['data-v'] = 'x'; |
| 86 expect(B.invocations, []); | 86 expect(B.invocations, []); |
| 87 | 87 |
| 88 b.attributes.remove('data-v'); | 88 b.attributes.remove('data-v'); |
| 89 expect(B.invocations, ['data-v: x => null']); | 89 expect(B.invocations, ['data-v: x => null']); |
| 90 }); | 90 }); |
| 91 }); | 91 }); |
| 92 | 92 |
| 93 group('unsupported_on_polyfill', () { | 93 group('unsupported_on_polyfill', () { |
| 94 test('add, change ID', () { | 94 test('add, change ID', () { |
| 95 B.invocations = []; |
| 96 |
| 95 var b = new B(); | 97 var b = new B(); |
| 96 b.id = 'x'; | 98 b.id = 'x'; |
| 97 expect(B.invocations, ['created', 'id: null => x']); | 99 expect(B.invocations, ['created', 'id: null => x']); |
| 98 | 100 |
| 99 B.invocations = []; | 101 B.invocations = []; |
| 100 b.attributes.remove('id'); | 102 b.attributes.remove('id'); |
| 101 expect(B.invocations, ['id: x => null']); | 103 expect(B.invocations, ['id: x => null']); |
| 102 }); | 104 }); |
| 103 | 105 |
| 104 test('add, change classes', () { | 106 test('add, change classes', () { |
| 105 var b = new B(); | 107 var b = new B(); |
| 106 | 108 |
| 107 B.invocations = []; | 109 B.invocations = []; |
| 108 b.classes.toggle('u'); | 110 b.classes.toggle('u'); |
| 109 expect(B.invocations, ['class: null => u']); | 111 expect(B.invocations, ['class: null => u']); |
| 110 }); | 112 }); |
| 111 }); | 113 }); |
| 112 } | 114 } |
| OLD | NEW |