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

Unified Diff: pkg/template_binding/test/template_binding_test.dart

Issue 355133002: switch Node.bind to interop (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/template_binding_test.dart
diff --git a/pkg/template_binding/test/template_binding_test.dart b/pkg/template_binding/test/template_binding_test.dart
index 42fd3897d65ebf36c285c739cf5f600c08624714..5501035f92ea05c12f9625223ef2d9976584e89d 100644
--- a/pkg/template_binding/test/template_binding_test.dart
+++ b/pkg/template_binding/test/template_binding_test.dart
@@ -168,7 +168,7 @@ templateInstantiationTests() {
runZoned(() {
templateBind(template).model = m;
}, onError: (e, s) {
- expect(e, isNoSuchMethodError);
+ _expectNoSuchMethod(e);
errorSeen = true;
});
return new Future(() {
@@ -252,7 +252,7 @@ templateInstantiationTests() {
runZoned(() {
templateBind(template).model = m;
}, onError: (e, s) {
- expect(e, isNoSuchMethodError);
+ _expectNoSuchMethod(e);
errorSeen = true;
});
@@ -2376,7 +2376,7 @@ templateInstantiationTests() {
var outer = templateBind(div.nodes.first);
var model = 1; // model is missing 'foo' should throw.
expect(() => outer.createInstance(model, new TestBindingSyntax()),
- throwsA(isNoSuchMethodError));
+ throwsA(_isNoSuchMethodError));
});
test('CreateInstance - async error', () {
@@ -2392,7 +2392,7 @@ templateInstantiationTests() {
bool seen = false;
runZoned(() => outer.createInstance(model, new TestBindingSyntax()),
onError: (e) {
- expect(e, isNoSuchMethodError);
+ _expectNoSuchMethod(e);
seen = true;
});
return new Future(() { expect(seen, isTrue); });
@@ -2593,6 +2593,16 @@ compatTests() {
});
}
+// TODO(jmesserly): ideally we could test the type with isNoSuchMethodError,
+// however dart:js converts the nSM into a String at some point.
+// So for now we do string comparison.
+_isNoSuchMethodError(e) => '$e'.contains('NoSuchMethodError');
Jennifer Messerly 2014/06/27 01:07:25 I still need to make a repro for this bug and file
Siggi Cherem (dart-lang) 2014/06/27 18:40:52 yikes!
Jennifer Messerly 2014/06/27 19:10:03 yeah :( I actually didn't try it on dart2js ... i
+
+_expectNoSuchMethod(e) {
+ // expect(e, isNoSuchMethodError);
+ expect('$e', contains('NoSuchMethodError'));
+}
+
class Issue285Syntax extends BindingDelegate {
prepareInstanceModel(template) {
if (template.id == 'del') return (val) => val * 2;

Powered by Google App Engine
This is Rietveld 408576698