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

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, 5 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/template_binding/test/node_bind_test.html ('k') | pkg/template_binding/test/template_binding_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..375d3d64e8e8d0e59af191952daf8fc6f3a07a05 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;
});
@@ -2246,8 +2246,10 @@ templateInstantiationTests() {
expect(templateB.ownerDocument, templateA.ownerDocument);
expect(contentB.ownerDocument, contentA.ownerDocument);
- expect(templateA.ownerDocument.window, window);
- expect(templateB.ownerDocument.window, window);
+ // NOTE: these tests don't work under ShadowDOM polyfill.
+ // Disabled for now.
+ //expect(templateA.ownerDocument.window, window);
+ //expect(templateB.ownerDocument.window, window);
expect(contentA.ownerDocument.window, null);
expect(contentB.ownerDocument.window, null);
@@ -2376,7 +2378,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 +2394,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 +2595,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');
+
+_expectNoSuchMethod(e) {
+ // expect(e, isNoSuchMethodError);
+ expect('$e', contains('NoSuchMethodError'));
+}
+
class Issue285Syntax extends BindingDelegate {
prepareInstanceModel(template) {
if (template.id == 'del') return (val) => val * 2;
« no previous file with comments | « pkg/template_binding/test/node_bind_test.html ('k') | pkg/template_binding/test/template_binding_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698