| 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 node_bindings_test; | 5 library node_bindings_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:mdv/mdv.dart' as mdv; | 9 import 'package:mdv/mdv.dart' as mdv; |
| 10 import 'package:observe/observe.dart'; | 10 import 'package:observe/observe.dart'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 setUp(() { | 29 setUp(() { |
| 30 document.body.append(testDiv = new DivElement()); | 30 document.body.append(testDiv = new DivElement()); |
| 31 }); | 31 }); |
| 32 | 32 |
| 33 tearDown(() { | 33 tearDown(() { |
| 34 testDiv.remove(); | 34 testDiv.remove(); |
| 35 testDiv = null; | 35 testDiv = null; |
| 36 }); | 36 }); |
| 37 | 37 |
| 38 dispatchEvent(type, target) { | |
| 39 target.dispatchEvent(new Event(type, cancelable: false)); | |
| 40 } | |
| 41 | |
| 42 observeTest('Text', () { | 38 observeTest('Text', () { |
| 43 var text = new Text('hi'); | 39 var text = new Text('hi'); |
| 44 var model = toSymbolMap({'a': 1}); | 40 var model = toSymbolMap({'a': 1}); |
| 45 text.bind('text', model, 'a'); | 41 text.bind('text', model, 'a'); |
| 46 expect(text.text, '1'); | 42 expect(text.text, '1'); |
| 47 | 43 |
| 48 model[sym('a')] = 2; | 44 model[sym('a')] = 2; |
| 49 performMicrotaskCheckpoint(); | 45 performMicrotaskCheckpoint(); |
| 50 expect(text.text, '2'); | 46 expect(text.text, '2'); |
| 51 | 47 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 expect(input.checked, false); | 149 expect(input.checked, false); |
| 154 | 150 |
| 155 input.click(); | 151 input.click(); |
| 156 expect(model[sym('x')], true); | 152 expect(model[sym('x')], true); |
| 157 performMicrotaskCheckpoint(); | 153 performMicrotaskCheckpoint(); |
| 158 | 154 |
| 159 input.click(); | 155 input.click(); |
| 160 expect(model[sym('x')], false); | 156 expect(model[sym('x')], false); |
| 161 }); | 157 }); |
| 162 } | 158 } |
| OLD | NEW |