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)); |
+ }); |
} |