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

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

Issue 317013007: Detect and wrap JS-CustomEvents if applicable. Include created_watcher and (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
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | pkg/polymer/test/js_custom_event_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/js_custom_event_test.dart
diff --git a/pkg/polymer/test/js_custom_event_test.dart b/pkg/polymer/test/js_custom_event_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7be77fb8b84bd00e4f7c0a72516438ea57e90a83
--- /dev/null
+++ b/pkg/polymer/test/js_custom_event_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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 polymer.test.web.events_test;
+
+import 'dart:html';
+import 'dart:js';
+import 'package:polymer/polymer.dart';
+import 'package:unittest/html_config.dart';
+import 'package:unittest/unittest.dart';
+
+@CustomTag('x-test')
+class XTest extends PolymerElement {
+ bool called = false;
+ XTest.created() : super.created();
+
+ void myEventHandler(e, detail, t) {
+ called = true;
+ expect(detail['value'], 42);
+ }
+}
+
+main() => initPolymer().run(() {
+ useHtmlConfiguration();
+ setUp(() => Polymer.onReady);
+
+ test('detail on JS custom events are proxied', () {
+ var element = querySelector('x-test');
+ expect(element.called, isFalse);
+ context.callMethod('fireEvent');
+ expect(element.called, isTrue);
+ });
+});
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | pkg/polymer/test/js_custom_event_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698