| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 var model = toSymbolMap({'a': {'b': false}}); | 365 var model = toSymbolMap({'a': {'b': false}}); |
| 366 input.bind('checked', model, 'a.b'); | 366 input.bind('checked', model, 'a.b'); |
| 367 | 367 |
| 368 input.click(); | 368 input.click(); |
| 369 expect(model[sym('a')][sym('b')], true); | 369 expect(model[sym('a')][sym('b')], true); |
| 370 | 370 |
| 371 input.click(); | 371 input.click(); |
| 372 expect(model[sym('a')][sym('b')], false); | 372 expect(model[sym('a')][sym('b')], false); |
| 373 }); | 373 }); |
| 374 | 374 |
| 375 test('Select selectedIndex', function() { | 375 test('Select selectedIndex', () { |
| 376 var select = new SelectElement(); | 376 var select = new SelectElement(); |
| 377 testDiv.append(select); | 377 testDiv.append(select); |
| 378 var option0 = select.append(new OptionElement()); | 378 var option0 = select.append(new OptionElement()); |
| 379 var option1 = select.append(new OptionElement()); | 379 var option1 = select.append(new OptionElement()); |
| 380 var option2 = select.append(new OptionElement()); | 380 var option2 = select.append(new OptionElement()); |
| 381 | 381 |
| 382 var model = toSymbolMap({'val': 2}); | 382 var model = toSymbolMap({'val': 2}); |
| 383 | 383 |
| 384 select.bind('selectedIndex', model, 'val'); | 384 select.bind('selectedIndex', model, 'val'); |
| 385 deliverChangeRecords(); | 385 deliverChangeRecords(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 398 | 398 |
| 399 var model = toSymbolMap({'foo': 'bar'}); | 399 var model = toSymbolMap({'foo': 'bar'}); |
| 400 el.attributes['foo'] = '{{foo}} {{foo}}'; | 400 el.attributes['foo'] = '{{foo}} {{foo}}'; |
| 401 template.model = model; | 401 template.model = model; |
| 402 | 402 |
| 403 deliverChangeRecords(); | 403 deliverChangeRecords(); |
| 404 el = testDiv.nodes[1]; | 404 el = testDiv.nodes[1]; |
| 405 expect(el.attributes['foo'], 'bar bar'); | 405 expect(el.attributes['foo'], 'bar bar'); |
| 406 }); | 406 }); |
| 407 } | 407 } |
| OLD | NEW |