| 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 polymer.test.bind_mdv_test; | 5 library polymer.test.bind_mdv_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:template_binding/template_binding.dart'; | 9 import 'package:template_binding/template_binding.dart'; |
| 10 import 'package:observe/observe.dart'; | 10 import 'package:observe/observe.dart'; |
| 11 import 'package:observe/mirrors_used.dart'; // make test smaller. | 11 import 'package:observe/mirrors_used.dart'; // make test smaller. |
| 12 import 'package:unittest/html_config.dart'; | 12 import 'package:unittest/html_config.dart'; |
| 13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 14 import 'package:web_components/polyfill.dart'; | 14 import 'package:web_components/polyfill.dart'; |
| 15 | 15 |
| 16 main() { | 16 main() { |
| 17 useHtmlConfiguration(); | 17 useHtmlConfiguration(); |
| 18 | 18 |
| 19 var registered = customElementsReady.then((_) { | 19 var registered = customElementsReady.then((_) { |
| 20 document.register('my-div', MyDivElement); | 20 document.registerElement('my-div', MyDivElement); |
| 21 }); | 21 }); |
| 22 | 22 |
| 23 setUp(() => registered); | 23 setUp(() => registered); |
| 24 | 24 |
| 25 group('bindModel', bindModelTests); | 25 group('bindModel', bindModelTests); |
| 26 } | 26 } |
| 27 | 27 |
| 28 bindModelTests() { | 28 bindModelTests() { |
| 29 var div; | 29 var div; |
| 30 | 30 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 Future onAttributeChange(Element node) { | 86 Future onAttributeChange(Element node) { |
| 87 var completer = new Completer(); | 87 var completer = new Completer(); |
| 88 new MutationObserver((records, observer) { | 88 new MutationObserver((records, observer) { |
| 89 observer.disconnect(); | 89 observer.disconnect(); |
| 90 completer.complete(); | 90 completer.complete(); |
| 91 })..observe(node, attributes: true); | 91 })..observe(node, attributes: true); |
| 92 scheduleMicrotask(Observable.dirtyCheck); | 92 scheduleMicrotask(Observable.dirtyCheck); |
| 93 return completer.future; | 93 return completer.future; |
| 94 } | 94 } |
| OLD | NEW |