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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/webmessaging/MessageEvent-trusted.html

Issue 2697453005: Import wpt@758b3b4cfa805067f36121333ba031e583d3a62c (Closed)
Patch Set: Add -expected.txt files. Created 3 years, 10 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>MessagePort message events are trusted</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <link rel="help" href="https://html.spec.whatwg.org/multipage/comms.html#dom-mes sageport-postmessage">
6 <!-- See also:
7 - https://github.com/whatwg/html/issues/1602
8 - https://github.com/whatwg/html/pull/1935
9 -->
10
11 <script>
12 "use strict";
13
14 async_test(t => {
15 assert_true("MessageChannel" in self, "The browser must support MessageChannel ");
16
17 const channel = new MessageChannel();
18
19 channel.port2.onmessage = t.step_func_done(e => {
20 assert_equals(e.isTrusted, true);
21 });
22
23 channel.port1.postMessage("ping");
24 }, "With a MessageChannel and its MessagePorts");
25
26 async_test(t => {
27 assert_true("BroadcastChannel" in self, "The browser must support BroadcastCha nnel");
28
29 const channel = new BroadcastChannel("channel name");
30
31 channel.onmessage = t.step_func_done(e => {
32 assert_equals(e.isTrusted, true);
33 });
34
35 new Worker("MessageEvent-trusted-worker.js");
36 }, "With a BroadcastChannel");
37
38 async_test(t => {
39 window.onmessage = t.step_func_done(e => {
40 assert_equals(e.isTrusted, true);
41 });
42
43 window.postMessage("ping", "*");
44 }, "With window");
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698