Chromium Code Reviews| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 | 7 |
| 8 import 'package:polymer_expressions/polymer_expressions.dart'; | 8 import 'package:polymer_expressions/polymer_expressions.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 import 'package:unittest/html_enhanced_config.dart'; | 10 import 'package:unittest/html_enhanced_config.dart'; |
| 11 import 'package:observe/observe.dart'; | 11 import 'package:observe/observe.dart'; |
| 12 import 'package:mdv/mdv.dart' as mdv; | 12 import 'package:mdv/mdv.dart' as mdv; |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 mdv.initialize(); | 15 mdv.initialize(); |
| 16 useHtmlEnhancedConfiguration(); | 16 useHtmlEnhancedConfiguration(); |
| 17 | 17 |
| 18 group('PolymerExpressions', () { | 18 group('PolymerExpressions', () { |
| 19 var testDiv; | 19 var testDiv; |
| 20 | 20 |
| 21 setUp(() { | 21 setUp(() { |
| 22 document.body.append(testDiv = new DivElement()); | 22 document.body.append(testDiv = new DivElement()); |
| 23 }); | 23 }); |
| 24 | 24 |
| 25 tearDown(() { | 25 tearDown(() { |
| 26 testDiv.remove(); | 26 testDiv.nodes[0].remove(); |
|
Jennifer Messerly
2013/09/18 07:30:06
firstChild?
justinfagnani
2013/09/18 17:24:15
Done.
| |
| 27 testDiv = null; | 27 testDiv = null; |
| 28 }); | 28 }); |
| 29 | 29 |
| 30 test('should make two-way bindings to inputs', () { | 30 test('should make two-way bindings to inputs', () { |
| 31 testDiv.nodes.add(new Element.html(''' | 31 testDiv.nodes.add(new Element.html(''' |
| 32 <template id="test" bind> | 32 <template id="test" bind> |
| 33 <input id="input" value="{{ firstName }}"> | 33 <input id="input" value="{{ firstName }}"> |
| 34 </template>''')); | 34 </template>''')); |
| 35 var person = new Person('John', 'Messerly', ['A', 'B', 'C']); | 35 var person = new Person('John', 'Messerly', ['A', 'B', 'C']); |
| 36 query('#test') | 36 query('#test') |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 List<String> get items => _items; | 96 List<String> get items => _items; |
| 97 | 97 |
| 98 void set items(List<String> value) { | 98 void set items(List<String> value) { |
| 99 _items = value; | 99 _items = value; |
| 100 notifyChange(new PropertyChangeRecord(_ITEMS)); | 100 notifyChange(new PropertyChangeRecord(_ITEMS)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; | 103 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; |
| 104 | 104 |
| 105 } | 105 } |
| OLD | NEW |