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

Unified Diff: tests/html/js_test.dart

Issue 35533003: Add test for calling emulated functions from JS (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_test.dart
diff --git a/tests/html/js_test.dart b/tests/html/js_test.dart
index e120895321461d7ff9bdb9ef9283fbc9cd7c1afb..facf3cb2e27a79fcc54f5bb459e357bb933f887e 100644
--- a/tests/html/js_test.dart
+++ b/tests/html/js_test.dart
@@ -201,6 +201,10 @@ class Color {
class TestDartObject {}
+class Callable {
+ call() => 'called';
+}
+
main() {
_injectJs();
useHtmlConfiguration();
@@ -460,7 +464,7 @@ main() {
});
- group('Dart callback', () {
+ group('Dart functions', () {
test('invoke Dart callback from JS', () {
expect(() => context.callMethod('invokeCallback'), throws);
@@ -498,6 +502,13 @@ main() {
expect(result, 42);
});
+ test('emulated functions should be callable in JS', () {
+ context['callable'] = new Callable();
+ var result = context.callMethod('callable');
+ expect(result, 'called');
+ context.deleteProperty('callable');
+ });
+
});
group('JsObject.jsify()', () {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698