Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: pkg/polymer_expressions/test/bindings_test.dart

Issue 50203004: port TemplateBinding to ed3266266e751b5ab1f75f8e0509d0d5f0ef35d8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 bindings_test; 5 library bindings_test;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 8
9 import 'package:logging/logging.dart'; 9 import 'package:logging/logging.dart';
10 import 'package:observe/observe.dart'; 10 import 'package:observe/observe.dart';
(...skipping 19 matching lines...) Expand all
30 testDiv.remove(); 30 testDiv.remove();
31 testDiv = null; 31 testDiv = null;
32 stop.cancel(); 32 stop.cancel();
33 stop = null; 33 stop = null;
34 messages = []; 34 messages = [];
35 }); 35 });
36 36
37 observeTest('should update binding when data changes', () { 37 observeTest('should update binding when data changes', () {
38 var model = new NotifyModel(); 38 var model = new NotifyModel();
39 var binding = new PolymerExpressions() 39 var binding = new PolymerExpressions()
40 .getBinding(model, 'x', null, null); 40 .prepareBinding('x', null, null)(model, null);
41 expect(binding.value, isNull); 41 expect(binding.value, isNull);
42 model.x = "hi"; 42 model.x = "hi";
43 performMicrotaskCheckpoint(); 43 performMicrotaskCheckpoint();
44 expect(binding.value, 'hi'); 44 expect(binding.value, 'hi');
45 expect(messages.length, 0); 45 expect(messages.length, 0);
46 }); 46 });
47 47
48 observeTest('should update text content when data changes', () { 48 observeTest('should update text content when data changes', () {
49 var model = new NotifyModel('abcde'); 49 var model = new NotifyModel('abcde');
50 var template = templateBind(new Element.html( 50 var template = templateBind(new Element.html(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 var _x; 123 var _x;
124 NotifyModel([this._x]); 124 NotifyModel([this._x]);
125 125
126 get x => _x; 126 get x => _x;
127 set x(value) { 127 set x(value) {
128 _x = notifyPropertyChange(#x, _x, value); 128 _x = notifyPropertyChange(#x, _x, value);
129 } 129 }
130 } 130 }
131 131
132 observeTest(name, testCase) => test(name, wrapMicrotask(testCase)); 132 observeTest(name, testCase) => test(name, wrapMicrotask(testCase));
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/lib/polymer_expressions.dart ('k') | pkg/template_binding/lib/src/binding_delegate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698