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

Unified Diff: tests/html/js_interop_2_test.dart

Issue 11824053: Implement port equality on SendPortSync (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 80 char fix Created 7 years, 11 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 | « sdk/lib/isolate/base.dart ('k') | tools/dom/src/Isolates.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_interop_2_test.dart
diff --git a/tests/html/js_interop_2_test.dart b/tests/html/js_interop_2_test.dart
index 7f7550af98f33c9e4cb1f88617cfb137905f3e7e..46a44debbcc9380e250b7ae3f2c3422a26665cae 100644
--- a/tests/html/js_interop_2_test.dart
+++ b/tests/html/js_interop_2_test.dart
@@ -26,6 +26,16 @@ var isolateTest = """
window.registerPort('test', port.toSendPort());
""";
+var portEqualityTest = """
+ function identity(data) {
+ return data;
+ }
+
+ var port = new ReceivePortSync();
+ port.receive(identity);
+ window.registerPort('identity', port.toSendPort());
+""";
+
main() {
useHtmlConfiguration();
@@ -39,4 +49,15 @@ main() {
result = port.callSync('ignore');
expect(result, isNull);
});
+
+ test('port-equality', () {
+ injectSource(portEqualityTest);
+
+ SendPortSync port1 = window.lookupPort('identity');
+ SendPortSync port2 = window.lookupPort('identity');
+ expect(port1, equals(port2));
+
+ SendPortSync port3 = port1.callSync(port2);
+ expect(port3, equals(port2));
+ });
}
« no previous file with comments | « sdk/lib/isolate/base.dart ('k') | tools/dom/src/Isolates.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698