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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/webmessaging/Channel_postMessage_target_source.htm

Issue 2558423002: Import wpt/webmessaging tests (Closed)
Patch Set: rebase again Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title> postMessage(): target port and source port </title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <div id=log></div>
10 <script>
11
12 var TARGET = null;
13 var SOURCE = null;
14 var description = "The postMessage() method - Let target port be the port wi th which source "
15 + "port is entangled, if any.";
16
17 var t = async_test("Test Description: " + description);
18
19 var channel = new MessageChannel();
20 SOURCE = channel.port1;
21 TARGET = channel.port2;
22 TARGET.start();
23 TARGET.addEventListener("message", t.step_func(TestMessageEvent), true);
24
25 SOURCE.postMessage("ping");
26
27 function TestMessageEvent(evt)
28 {
29 assert_equals(evt.target, TARGET);
30 assert_not_equals(evt.target, SOURCE);
31 t.done();
32 }
33 </script>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698