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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/postMessage_clone_port.htm

Issue 2418853003: Worker: Import "imported/wpt/workers" tests (Retry) (Closed)
Patch Set: rebase Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title> postMessage(): clone a port </title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <div id=log></div>
6 <script>
7 async_test(function(t) {
8 var channelA = new MessageChannel();
9 var channelB = new MessageChannel();
10 var originalPort = channelB.port2;
11 channelA.port2.onmessage = t.step_func(function(e) {
12 assert_equals(e.data, "ports");
13 var clonedPort = e.ports[0];
14 assert_not_equals(clonedPort, originalPort, "new cloned port object should n ot equal to the original port!");
15 clonedPort.onmessage = t.step_func_done(function(e) {
16 assert_equals(e.data, "ping", "Data sent through remote port is received b y the new cloned port");
17 });
18 });
19 channelA.port1.postMessage("ports", [channelB.port2]);
20 channelB.port1.postMessage("ping");
21 });
22 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698