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

Unified Diff: pkg/polymer_expressions/test/bindings_test.dart

Issue 263833027: Fix two-way binding in polymer expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/polymer_expressions/lib/polymer_expressions.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/test/bindings_test.dart
diff --git a/pkg/polymer_expressions/test/bindings_test.dart b/pkg/polymer_expressions/test/bindings_test.dart
index 957b3582873fefcd9ef9a9bc24a2552a67867cbe..5e681c9fcd3bd42e8c5fe019f375732b8522bcc6 100644
--- a/pkg/polymer_expressions/test/bindings_test.dart
+++ b/pkg/polymer_expressions/test/bindings_test.dart
@@ -82,8 +82,9 @@ main() => dirtyCheckZone().run(() {
'<template><input id="i1" value={{x}}></template>'));
testDiv.append(template.createInstance(model, new PolymerExpressions()));
+ var el;
return new Future(() {
- var el = testDiv.query("#i1");
+ el = testDiv.query("#i1");
var subscription = el.onInput.listen(expectAsync((_) {}, count: 1));
el.focus();
@@ -113,8 +114,19 @@ main() => dirtyCheckZone().run(() {
// selection will be preserved.
expect(el.selectionStart, 4);
expect(el.selectionEnd, 4);
-
subscription.cancel();
+ }).then(_nextMicrotask).then((_) {
+ // Nothing changes on the next micro task.
+ expect(el.selectionStart, 4);
+ expect(el.selectionEnd, 4);
+ }).then((_) => window.animationFrame).then((_) {
+ // ... or on the next animation frame.
+ expect(el.selectionStart, 4);
+ expect(el.selectionEnd, 4);
+ }).then(_afterTimeout).then((_) {
+ // ... or later.
+ expect(el.selectionStart, 4);
+ expect(el.selectionEnd, 4);
});
});
@@ -142,6 +154,7 @@ main() => dirtyCheckZone().run(() {
});
_nextMicrotask(_) => new Future(() {});
+_afterTimeout(_) => new Future.delayed(new Duration(milliseconds: 30), () {});
@reflectable
class NotifyModel extends ChangeNotifier {
« no previous file with comments | « pkg/polymer_expressions/lib/polymer_expressions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698