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

Unified Diff: tests/html/js_interop_func_passing_test.dart

Issue 10914129: Remove proxying support from dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regen dart:html Created 8 years, 3 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 | « tests/html/js_interop_element_test.dart ('k') | tests/html/js_interop_obj_invoke_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_interop_func_passing_test.dart
diff --git a/tests/html/js_interop_func_passing_test.dart b/tests/html/js_interop_func_passing_test.dart
deleted file mode 100644
index 74aff0fba9e3aaa52fccffc9506cdceb5b668b80..0000000000000000000000000000000000000000
--- a/tests/html/js_interop_func_passing_test.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2012, 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('JsInteropFuncPassingTest');
-#import('../../pkg/unittest/unittest.dart');
-#import('../../pkg/unittest/html_config.dart');
-#import('dart:html');
-#import('dart:isolate');
-
-injectSource(code) {
- final script = new ScriptElement();
- script.type = 'text/javascript';
- script.innerHTML = code;
- document.body.nodes.add(script);
-}
-
-var dartToJsTest = """
- var port = new ReceivePortSync();
- port.receive(function (f) {
- return f('fromJS');
- });
- window.registerPort('test1', port.toSendPort());
-""";
-
-var jsToDartTest = """
- var port1 = window.lookupPort('test2a');
- var result = port1.callSync(function (x) {
- return x*2;
- });
-
- var port2 = window.lookupPort('test2b');
- port2.callSync(result);
-""";
-
-var dartToJsToDartTest = """
- var port = new ReceivePortSync();
- port.receive(function (f) {
- return f;
- });
- window.registerPort('test3', port.toSendPort());
-""";
-
-main() {
- useHtmlConfiguration();
-
- test('dart-to-js-function', () {
- injectSource(dartToJsTest);
-
- SendPortSync port = window.lookupPort('test1');
- var result = port.callSync((msg) {
- Expect.equals('fromJS', msg);
- return 'received';
- });
- Expect.equals('received', result);
- });
-
- test('js-to-dart-function', () {
- var port1 = new ReceivePortSync();
- int invoked1 = 0;
- port1.receive((f) {
- ++invoked1;
- var data = f(21);
- expect(data, equals(42));
- return 'fromDart';
- });
- window.registerPort('test2a', port1.toSendPort());
-
- var port2 = new ReceivePortSync();
- int invoked2 = 0;
- port2.receive((x) {
- ++invoked2;
- expect(x, equals('fromDart'));
- });
- window.registerPort('test2b', port2.toSendPort());
-
- injectSource(jsToDartTest);
-
- expect(1, equals(invoked1));
- expect(1, equals(invoked2));
- });
-
- test('dart-to-js-to-dart-function', () {
- injectSource(dartToJsToDartTest);
-
- validate(x) {
- expect(x, equals('fromCaller'));
- return 'fromCallee';
- }
-
- SendPortSync port = window.lookupPort('test3');
- var f = port.callSync(validate);
- var result = f('fromCaller');
- Expect.equals('fromCallee', result);
-
- });
-}
« no previous file with comments | « tests/html/js_interop_element_test.dart ('k') | tests/html/js_interop_obj_invoke_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698