| 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_individual_config.dart'; | 9 import 'package:unittest/html_config.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 useHtmlIndividualConfiguration(); | 12 useHtmlConfiguration(); |
| 13 | 13 |
| 14 // Load the MutationObserver polyfill. | 14 // Load the MutationObserver polyfill. |
| 15 HttpRequest.getString('/root_dart/pkg/mutation_observer/lib/' | 15 HttpRequest.getString('/root_dart/pkg/mutation_observer/lib/' |
| 16 'mutation_observer.min.js').then((code) { | 16 'mutation_observer.min.js').then((code) { |
| 17 | 17 |
| 18 // Force MutationObserver polyfill to be used so we can test it, even in | 18 // Force MutationObserver polyfill to be used so we can test it, even in |
| 19 // browsers with native support. | 19 // browsers with native support. |
| 20 document.head.children.add(new ScriptElement() | 20 document.head.children.add(new ScriptElement() |
| 21 ..text = 'window.MutationObserver = void 0;' | 21 ..text = 'window.MutationObserver = void 0;' |
| 22 'window.WebKitMutationObserver = void 0;' | 22 'window.WebKitMutationObserver = void 0;' |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 test('mutation event', () { | 105 test('mutation event', () { |
| 106 var event = new MutationEvent('something', prevValue: 'prev', | 106 var event = new MutationEvent('something', prevValue: 'prev', |
| 107 newValue: 'new', attrName: 'attr'); | 107 newValue: 'new', attrName: 'attr'); |
| 108 expect(event is MutationEvent, isTrue); | 108 expect(event is MutationEvent, isTrue); |
| 109 expect(event.prevValue, 'prev'); | 109 expect(event.prevValue, 'prev'); |
| 110 expect(event.newValue, 'new'); | 110 expect(event.newValue, 'new'); |
| 111 expect(event.attrName, 'attr'); | 111 expect(event.attrName, 'attr'); |
| 112 }); | 112 }); |
| 113 }); | 113 }); |
| 114 } | 114 } |
| OLD | NEW |