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

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

Issue 232373002: pkg/polymer[_expressions] unittest fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: oops Created 6 years, 8 months 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:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 9
10 import 'package:observe/observe.dart'; 10 import 'package:observe/observe.dart';
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }); 77 });
78 78
79 test('should preserve the cursor position', () { 79 test('should preserve the cursor position', () {
80 var model = new NotifyModel('abcde'); 80 var model = new NotifyModel('abcde');
81 var template = templateBind(new Element.html( 81 var template = templateBind(new Element.html(
82 '<template><input id="i1" value={{x}}></template>')); 82 '<template><input id="i1" value={{x}}></template>'));
83 testDiv.append(template.createInstance(model, new PolymerExpressions())); 83 testDiv.append(template.createInstance(model, new PolymerExpressions()));
84 84
85 return new Future(() { 85 return new Future(() {
86 var el = testDiv.query("#i1"); 86 var el = testDiv.query("#i1");
87 var subscription = el.onInput.listen(expectAsync1((_) {}, count: 1)); 87 var subscription = el.onInput.listen(expectAsync((_) {}, count: 1));
88 el.focus(); 88 el.focus();
89 89
90 expect(el.value, 'abcde'); 90 expect(el.value, 'abcde');
91 expect(model.x, 'abcde'); 91 expect(model.x, 'abcde');
92 92
93 el.selectionStart = 3; 93 el.selectionStart = 3;
94 el.selectionEnd = 3; 94 el.selectionEnd = 3;
95 expect(el.selectionStart, 3); 95 expect(el.selectionStart, 3);
96 expect(el.selectionEnd, 3); 96 expect(el.selectionEnd, 3);
97 97
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 @reflectable 146 @reflectable
147 class NotifyModel extends ChangeNotifier { 147 class NotifyModel extends ChangeNotifier {
148 var _x; 148 var _x;
149 NotifyModel([this._x]); 149 NotifyModel([this._x]);
150 150
151 get x => _x; 151 get x => _x;
152 set x(value) { 152 set x(value) {
153 _x = notifyPropertyChange(#x, _x, value); 153 _x = notifyPropertyChange(#x, _x, value);
154 } 154 }
155 } 155 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/property_observe_test.dart ('k') | pkg/polymer_expressions/test/syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698