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

Unified Diff: tests/html/js_test.dart

Issue 222203009: Execute callbacks from JS in the correct zone Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add Dartium support Created 6 years, 8 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
« sdk/lib/js/dartium/js_dartium.dart ('K') | « sdk/lib/js/dartium/js_dartium.dart ('k') | 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 081ab0270576c4bd3a86d22885eae90a21c73fba..04b5a29e48f2568952d4f229a932442955cbf886 100644
--- a/tests/html/js_test.dart
+++ b/tests/html/js_test.dart
@@ -659,6 +659,20 @@ main() {
context.deleteProperty('callback');
});
+ test('invoke Dart callback from JS in a Zone', () {
+ expect(() => context.callMethod('invokeCallback'), throws);
+
+ var childZone = Zone.current.fork();
+ childZone.run(() {
+ context['callback'] = () {
+ expect(Zone.current, childZone);
+ };
+ });
+ context.callMethod('invokeCallback');
+
+ context.deleteProperty('callback');
+ });
+
test('callback as parameter', () {
expect(context.callMethod('getTypeOf', [context['razzle']]),
equals("function"));
« sdk/lib/js/dartium/js_dartium.dart ('K') | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698