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

Unified Diff: pkg/polymer/test/custom_event_test.dart

Issue 105493003: workaround for event handlers: don't return StreamSubscription as model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/custom_event_test.dart
diff --git a/pkg/polymer/test/custom_event_test.dart b/pkg/polymer/test/custom_event_test.dart
index 0a6b197e8a0c0139540f28716e9523c3cdf20151..eef68e09a3d723ee166dca378b0f9b700f7be03f 100644
--- a/pkg/polymer/test/custom_event_test.dart
+++ b/pkg/polymer/test/custom_event_test.dart
@@ -7,6 +7,7 @@ library polymer.test.web.custom_event_test;
import 'dart:async';
import 'dart:html';
import 'package:polymer/polymer.dart';
+import 'package:template_binding/template_binding.dart' show nodeBind;
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
@@ -50,6 +51,13 @@ main() {
test('custom event', () {
final testComp = query('test-custom-event');
final fooBar = testComp.fooBar;
+
+ final binding = nodeBind(fooBar).bindings['on-barbaz'];
+ expect(binding, isNotNull, reason: 'on-barbaz event should be bound');
+
+ expect(binding.model is! StreamSubscription, true,
+ reason: 'event bindings should not be a StreamSubscription');
+
fooBar.fireFoo(123);
fooBar.fireBarBaz(42);
fooBar.fireFoo(777);
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698