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

Side by Side Diff: pkg/polymer/test/unbind_test.dart

Issue 172923002: [polymer] fix editor hints -- query/queryAll and unused imports (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « pkg/polymer/test/template_distribute_dynamic_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 polymer.test.unbind_test; 5 library polymer.test.unbind_test;
6 6
7 import 'dart:async' show Future, scheduleMicrotask; 7 import 'dart:async' show Future, scheduleMicrotask;
8 import 'dart:html'; 8 import 'dart:html';
9 9
10 @MirrorsUsed(targets: const [Polymer], override: 'polymer.test.unbind_test') 10 @MirrorsUsed(targets: const [Polymer], override: 'polymer.test.unbind_test')
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // extra beat. 62 // extra beat.
63 delay(x) => new Future.delayed(new Duration(milliseconds: 50), () => x); 63 delay(x) => new Future.delayed(new Duration(milliseconds: 50), () => x);
64 64
65 // TODO(jmesserly): fix this when it's easier to get a private symbol. 65 // TODO(jmesserly): fix this when it's easier to get a private symbol.
66 final unboundSymbol = reflectClass(Polymer).declarations.keys 66 final unboundSymbol = reflectClass(Polymer).declarations.keys
67 .firstWhere((s) => MirrorSystem.getName(s) == '_unbound'); 67 .firstWhere((s) => MirrorSystem.getName(s) == '_unbound');
68 68
69 _unbound(node) => reflect(node).getField(unboundSymbol).reflectee; 69 _unbound(node) => reflect(node).getField(unboundSymbol).reflectee;
70 70
71 unbindTests() { 71 unbindTests() {
72 var xTest = document.query('x-test'); 72 var xTest = document.querySelector('x-test');
73 xTest.foo = 'bar'; 73 xTest.foo = 'bar';
74 scheduleMicrotask(Observable.dirtyCheck); 74 scheduleMicrotask(Observable.dirtyCheck);
75 75
76 return delay(null).then((_) { 76 return delay(null).then((_) {
77 expect(_unbound(xTest), null, reason: 77 expect(_unbound(xTest), null, reason:
78 'element is bound when inserted'); 78 'element is bound when inserted');
79 expect(xTest.fooWasChanged, true, reason: 79 expect(xTest.fooWasChanged, true, reason:
80 'element is actually bound'); 80 'element is actually bound');
81 xTest.remove(); 81 xTest.remove();
82 }).then(delay).then((_) { 82 }).then(delay).then((_) {
(...skipping 23 matching lines...) Expand all
106 }).then(delay).then((node) { 106 }).then(delay).then((node) {
107 expect(_unbound(node), null, reason: 107 expect(_unbound(node), null, reason:
108 'element is bound when manually inserted'); 108 'element is bound when manually inserted');
109 node.remove(); 109 node.remove();
110 return node; 110 return node;
111 }).then(delay).then((node) { 111 }).then(delay).then((node) {
112 expect(_unbound(node), true, reason: 112 expect(_unbound(node), true, reason:
113 'element is unbound when manually removed is called'); 113 'element is unbound when manually removed is called');
114 }); 114 });
115 } 115 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/template_distribute_dynamic_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698