| 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 mutation_observer_test; | 5 library mutation_observer_test; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 import 'package:unittest/html_config.dart'; | 9 import 'package:unittest/html_config.dart'; |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 var container = new DivElement(); | 94 var container = new DivElement(); |
| 95 var div1 = new DivElement(); | 95 var div1 = new DivElement(); |
| 96 var div2 = new DivElement(); | 96 var div2 = new DivElement(); |
| 97 var mutationObserver = new MutationObserver( | 97 var mutationObserver = new MutationObserver( |
| 98 mutationCallback(2, orderedEquals([div1, div2]))); | 98 mutationCallback(2, orderedEquals([div1, div2]))); |
| 99 mutationObserver.observe(container, childList: true, subtree: true); | 99 mutationObserver.observe(container, childList: true, subtree: true); |
| 100 | 100 |
| 101 container.append(div1); | 101 container.append(div1); |
| 102 div1.append(div2); | 102 div1.append(div2); |
| 103 }); | 103 }); |
| 104 | |
| 105 test('mutation event', () { | |
| 106 var event = new MutationEvent('something', prevValue: 'prev', | |
| 107 newValue: 'new', attrName: 'attr'); | |
| 108 expect(event is MutationEvent, isTrue); | |
| 109 expect(event.prevValue, 'prev'); | |
| 110 expect(event.newValue, 'new'); | |
| 111 expect(event.attrName, 'attr'); | |
| 112 }); | |
| 113 }); | 104 }); |
| 114 } | 105 } |
| OLD | NEW |