Skip to content

Commit 947c82a

Browse files
committed
Bug 1949819 [wpt PR 50871] - add disconnected tests for command events, a=testonly
Automatic update from web-platform-tests Add disconnected tests for command events For whatwg/html#11049. -- wpt-commits: b0c8f027e0657bc8c8d78156edd71400a4630b40 wpt-pr: 50871 UltraBlame original commit: dd6bd09b1b756ee164a9d1895508bf08d2e92728
1 parent 49cb2fb commit 947c82a

File tree

2 files changed

+765
-0
lines changed

2 files changed

+765
-0
lines changed
Lines changed: 390 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,390 @@
1+
<
2+
!
3+
doctype
4+
html
5+
>
6+
<
7+
meta
8+
charset
9+
=
10+
"
11+
utf
12+
-
13+
8
14+
"
15+
/
16+
>
17+
<
18+
meta
19+
name
20+
=
21+
"
22+
author
23+
"
24+
title
25+
=
26+
"
27+
Keith
28+
Cirkel
29+
"
30+
href
31+
=
32+
"
33+
mailto
34+
:
35+
wpt
36+
keithcirkel
37+
.
38+
co
39+
.
40+
uk
41+
"
42+
/
43+
>
44+
<
45+
meta
46+
name
47+
=
48+
"
49+
timeout
50+
"
51+
content
52+
=
53+
"
54+
long
55+
"
56+
>
57+
<
58+
link
59+
rel
60+
=
61+
"
62+
help
63+
"
64+
href
65+
=
66+
"
67+
https
68+
:
69+
/
70+
/
71+
open
72+
-
73+
ui
74+
.
75+
org
76+
/
77+
components
78+
/
79+
invokers
80+
.
81+
explainer
82+
/
83+
"
84+
/
85+
>
86+
<
87+
script
88+
src
89+
=
90+
"
91+
/
92+
resources
93+
/
94+
testharness
95+
.
96+
js
97+
"
98+
>
99+
<
100+
/
101+
script
102+
>
103+
<
104+
script
105+
src
106+
=
107+
"
108+
/
109+
resources
110+
/
111+
testharnessreport
112+
.
113+
js
114+
"
115+
>
116+
<
117+
/
118+
script
119+
>
120+
<
121+
script
122+
src
123+
=
124+
"
125+
/
126+
resources
127+
/
128+
testdriver
129+
.
130+
js
131+
"
132+
>
133+
<
134+
/
135+
script
136+
>
137+
<
138+
script
139+
src
140+
=
141+
"
142+
/
143+
resources
144+
/
145+
testdriver
146+
-
147+
actions
148+
.
149+
js
150+
"
151+
>
152+
<
153+
/
154+
script
155+
>
156+
<
157+
script
158+
src
159+
=
160+
"
161+
/
162+
resources
163+
/
164+
testdriver
165+
-
166+
vendor
167+
.
168+
js
169+
"
170+
>
171+
<
172+
/
173+
script
174+
>
175+
<
176+
script
177+
src
178+
=
179+
"
180+
resources
181+
/
182+
invoker
183+
-
184+
utils
185+
.
186+
js
187+
"
188+
>
189+
<
190+
/
191+
script
192+
>
193+
<
194+
dialog
195+
id
196+
=
197+
"
198+
invokee
199+
"
200+
>
201+
<
202+
/
203+
dialog
204+
>
205+
<
206+
button
207+
id
208+
=
209+
"
210+
invokerbutton
211+
"
212+
commandfor
213+
=
214+
"
215+
invokee
216+
"
217+
command
218+
=
219+
"
220+
show
221+
-
222+
modal
223+
"
224+
>
225+
<
226+
/
227+
button
228+
>
229+
<
230+
script
231+
>
232+
const
233+
invokee
234+
=
235+
document
236+
.
237+
getElementById
238+
(
239+
'
240+
invokee
241+
'
242+
)
243+
;
244+
promise_test
245+
(
246+
async
247+
function
248+
(
249+
t
250+
)
251+
{
252+
assert_false
253+
(
254+
invokee
255+
.
256+
open
257+
"
258+
invokee
259+
.
260+
open
261+
"
262+
)
263+
;
264+
assert_false
265+
(
266+
invokee
267+
.
268+
matches
269+
(
270+
"
271+
:
272+
modal
273+
"
274+
)
275+
"
276+
invokee
277+
:
278+
modal
279+
"
280+
)
281+
;
282+
let
283+
fired
284+
=
285+
false
286+
;
287+
invokee
288+
.
289+
addEventListener
290+
(
291+
'
292+
command
293+
'
294+
(
295+
)
296+
=
297+
>
298+
{
299+
fired
300+
=
301+
true
302+
;
303+
invokee
304+
.
305+
remove
306+
(
307+
)
308+
;
309+
}
310+
)
311+
;
312+
await
313+
clickOn
314+
(
315+
invokerbutton
316+
)
317+
;
318+
assert_true
319+
(
320+
fired
321+
"
322+
command
323+
event
324+
fired
325+
"
326+
)
327+
;
328+
assert_false
329+
(
330+
invokee
331+
.
332+
isConnected
333+
"
334+
dialog
335+
no
336+
longer
337+
connected
338+
"
339+
)
340+
;
341+
assert_false
342+
(
343+
invokee
344+
.
345+
open
346+
"
347+
invokee
348+
.
349+
open
350+
"
351+
)
352+
;
353+
assert_false
354+
(
355+
invokee
356+
.
357+
matches
358+
(
359+
"
360+
:
361+
modal
362+
"
363+
)
364+
"
365+
invokee
366+
:
367+
modal
368+
"
369+
)
370+
;
371+
}
372+
invoking
373+
a
374+
dialog
375+
and
376+
removing
377+
during
378+
command
379+
event
380+
does
381+
not
382+
raise
383+
an
384+
error
385+
)
386+
;
387+
<
388+
/
389+
script
390+
>

0 commit comments

Comments
 (0)