| 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.unbind_test; | 5 library polymer.test.unbind_test; |
| 6 | 6 |
| 7 import 'dart:async' show Future, scheduleMicrotask; | 7 import 'dart:async' show Future, scheduleMicrotask; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 | 9 |
| 10 @MirrorsUsed(targets: const [Polymer], override: 'polymer.test.unbind_test') | 10 @MirrorsUsed(targets: const [Polymer], override: 'polymer.test.unbind_test') |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 fooWasChanged = true; | 32 fooWasChanged = true; |
| 33 } | 33 } |
| 34 | 34 |
| 35 barChanged() { | 35 barChanged() { |
| 36 validBar = bar; | 36 validBar = bar; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool get isBarValid => validBar == bar; | 39 bool get isBarValid => validBar == bar; |
| 40 } | 40 } |
| 41 | 41 |
| 42 @initMethod |
| 42 main() { | 43 main() { |
| 43 initPolymer(); | |
| 44 useHtmlConfiguration(); | 44 useHtmlConfiguration(); |
| 45 | 45 |
| 46 setUp(() => Polymer.onReady); | 46 setUp(() => Polymer.onReady); |
| 47 | 47 |
| 48 test('unbind', unbindTests); | 48 test('unbind', unbindTests); |
| 49 } | 49 } |
| 50 | 50 |
| 51 Future testAsync(List<Function> tests, int delayMs, [List args]) { | 51 Future testAsync(List<Function> tests, int delayMs, [List args]) { |
| 52 if (tests.length == 0) return new Future.value(); | 52 if (tests.length == 0) return new Future.value(); |
| 53 // TODO(jmesserly): CustomElements.takeRecords(); | 53 // TODO(jmesserly): CustomElements.takeRecords(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 }).then(delay).then((node) { | 106 }).then(delay).then((node) { |
| 107 expect(_unbound(node), null, reason: | 107 expect(_unbound(node), null, reason: |
| 108 'element is bound when manually inserted'); | 108 'element is bound when manually inserted'); |
| 109 node.remove(); | 109 node.remove(); |
| 110 return node; | 110 return node; |
| 111 }).then(delay).then((node) { | 111 }).then(delay).then((node) { |
| 112 expect(_unbound(node), true, reason: | 112 expect(_unbound(node), true, reason: |
| 113 'element is unbound when manually removed is called'); | 113 'element is unbound when manually removed is called'); |
| 114 }); | 114 }); |
| 115 } | 115 } |
| OLD | NEW |