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

Unified Diff: pkg/template_binding/test/node_bind_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, 2 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
Index: pkg/template_binding/test/node_bind_test.dart
diff --git a/pkg/template_binding/test/node_bindings_test.dart b/pkg/template_binding/test/node_bind_test.dart
similarity index 95%
rename from pkg/template_binding/test/node_bindings_test.dart
rename to pkg/template_binding/test/node_bind_test.dart
index 6391b385b4ca34b0dd492ea907453ae4ac8312b2..fbedcfa3271724e2151f29ee29d02f95bc3800c7 100644
--- a/pkg/template_binding/test/node_bindings_test.dart
+++ b/pkg/template_binding/test/node_bind_test.dart
@@ -2,17 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library template_binding.test.node_bindings_test;
+library template_binding.test.node_bind_test;
import 'dart:html';
-@MirrorsUsed(targets: const [NodeBinding], override:
- 'template_binding.test.node_bindings_test')
-import 'dart:mirrors';
-
import 'package:observe/observe.dart' show toObservable, PathObserver;
-import 'package:template_binding/template_binding.dart'
- show nodeBind, NodeBinding;
+import 'package:template_binding/template_binding.dart' show nodeBind;
+import 'package:template_binding/src/node_binding.dart' show getObserverForTest;
+
import 'package:unittest/html_config.dart';
import 'package:unittest/unittest.dart';
import 'utils.dart';
@@ -72,9 +69,6 @@ testBindings() {
});
observeTest('Observer is Model', () {
- _observer(x) => reflect(x).getField(
- privateSymbol(NodeBinding, '_observer')).reflectee;
-
var text = new Text('');
var model = toObservable({'a': {'b': {'c': 1}}});
var observer = new PathObserver(model, 'a.b.c');
@@ -83,7 +77,7 @@ testBindings() {
var binding = nodeBind(text).bindings['text'];
expect(binding, isNotNull);
- expect(privateField(binding, '_observer'), observer,
+ expect(getObserverForTest(binding), observer,
reason: 'should reuse observer');
model['a']['b']['c'] = 2;
@@ -654,17 +648,3 @@ formBindings() {
expect(select.value, 'a');
});
}
-
-privateField(x, name) => reflect(x).getField(
- privateSymbol(reflect(x).type, name)).reflectee;
-
-// TODO(jmesserly): fix this when it's easier to get a private symbol.
-privateSymbol(TypeMirror type, String name) {
- while (type != null) {
- var symbol = type.variables.keys.firstWhere(
- (s) => MirrorSystem.getName(s) == name, orElse: () => null);
- if (symbol != null) return symbol;
- type = type.superclass;
- }
- return null;
-}
« no previous file with comments | « pkg/template_binding/test/custom_element_bindings_test.dart ('k') | pkg/template_binding/test/node_bindings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698