Skip to content

Commit 1c13bec

Browse files
committed
Bug 1949254 [wpt PR 50808] - Improve testing dialog closedby and requestClose, a=testonly
Automatic update from web-platform-tests Improve testing dialog closedby and requestClose See this request: whatwg/html#10983 (comment) plus this comment: https://chromium-review.googlesource.com/c/chromium/src/+/6245064/comments/e932d31a_c996d18e This just adds more testing of dialog closedby and requestClose, to make sure close watchers are still set up, the `:open` pseudo class works properly, events get fired correctly, etc., when the dialog `open` attribute is manually added and removed. Bug: 376516550 Change-Id: Ibdee09c5f722db2ce97c64c38c39726c1503e1d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6253798 Auto-Submit: Mason Freed <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Reviewed-by: Joey Arhar <jarharchromium.org> Reviewed-by: Luke <lwarlowigalia.com> Cr-Commit-Position: refs/heads/main{#1422074} -- wpt-commits: 57d6088fe0481e9662763d2147831219e692d3bc wpt-pr: 50808 UltraBlame original commit: 9668c9902b5818811f24cb50228e71a8fa1ca08e
1 parent 7e65238 commit 1c13bec

3 files changed

Lines changed: 444 additions & 27 deletions

File tree

testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-closedby-start-open.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,19 @@
233233
open
234234
)
235235
;
236+
assert_true
237+
(
238+
dialog
239+
.
240+
matches
241+
(
242+
'
243+
:
244+
open
245+
'
246+
)
247+
)
248+
;
236249
await
237250
new
238251
test_driver
@@ -252,6 +265,19 @@
252265
open
253266
)
254267
;
268+
assert_false
269+
(
270+
dialog
271+
.
272+
matches
273+
(
274+
'
275+
:
276+
open
277+
'
278+
)
279+
)
280+
;
255281
dialog
256282
.
257283
showModal
@@ -265,6 +291,19 @@
265291
open
266292
)
267293
;
294+
assert_true
295+
(
296+
dialog
297+
.
298+
matches
299+
(
300+
'
301+
:
302+
open
303+
'
304+
)
305+
)
306+
;
268307
await
269308
new
270309
test_driver
@@ -284,6 +323,19 @@
284323
open
285324
)
286325
;
326+
assert_false
327+
(
328+
dialog
329+
.
330+
matches
331+
(
332+
'
333+
:
334+
open
335+
'
336+
)
337+
)
338+
;
287339
}
288340
Dialogs
289341
that
@@ -483,6 +535,19 @@
483535
open
484536
)
485537
;
538+
assert_true
539+
(
540+
dialog
541+
.
542+
matches
543+
(
544+
'
545+
:
546+
open
547+
'
548+
)
549+
)
550+
;
486551
await
487552
new
488553
test_driver
@@ -508,6 +573,19 @@
508573
'
509574
)
510575
;
576+
assert_false
577+
(
578+
dialog
579+
.
580+
matches
581+
(
582+
'
583+
:
584+
open
585+
'
586+
)
587+
)
588+
;
511589
}
512590
Opening
513591
and

testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/dialog-closedby.html

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,19 @@
378378
open
379379
)
380380
;
381+
assert_false
382+
(
383+
dialog
384+
.
385+
matches
386+
(
387+
'
388+
:
389+
open
390+
'
391+
)
392+
)
393+
;
381394
if
382395
(
383396
modal
@@ -406,6 +419,19 @@
406419
open
407420
)
408421
;
422+
assert_true
423+
(
424+
dialog
425+
.
426+
matches
427+
(
428+
'
429+
:
430+
open
431+
'
432+
)
433+
)
434+
;
409435
assert_equals
410436
(
411437
dialog
@@ -453,6 +479,19 @@
453479
open
454480
)
455481
;
482+
assert_false
483+
(
484+
dialog
485+
.
486+
matches
487+
(
488+
'
489+
:
490+
open
491+
'
492+
)
493+
)
494+
;
456495
t
457496
.
458497
add_cleanup
@@ -514,6 +553,20 @@
514553
.
515554
open
516555
;
556+
const
557+
respondsToEsc2
558+
=
559+
!
560+
dialog
561+
.
562+
matches
563+
(
564+
'
565+
:
566+
open
567+
'
568+
)
569+
;
517570
dialog
518571
.
519572
close
@@ -545,6 +598,20 @@
545598
.
546599
open
547600
;
601+
const
602+
respondsToLightDismiss2
603+
=
604+
!
605+
dialog
606+
.
607+
matches
608+
(
609+
'
610+
:
611+
open
612+
'
613+
)
614+
;
548615
dialog
549616
.
550617
close
@@ -603,6 +670,22 @@
603670
;
604671
assert_true
605672
(
673+
respondsToEsc2
674+
'
675+
Dialog
676+
should
677+
respond
678+
to
679+
ESC
680+
(
681+
:
682+
open
683+
)
684+
'
685+
)
686+
;
687+
assert_true
688+
(
606689
respondsToLightDismiss
607690
'
608691
Dialog
@@ -614,6 +697,23 @@
614697
'
615698
)
616699
;
700+
assert_true
701+
(
702+
respondsToLightDismiss2
703+
'
704+
Dialog
705+
should
706+
respond
707+
to
708+
light
709+
dismiss
710+
(
711+
:
712+
open
713+
)
714+
'
715+
)
716+
;
617717
break
618718
;
619719
case
@@ -633,6 +733,22 @@
633733
'
634734
)
635735
;
736+
assert_true
737+
(
738+
respondsToEsc2
739+
'
740+
Dialog
741+
should
742+
respond
743+
to
744+
ESC
745+
(
746+
:
747+
open
748+
)
749+
'
750+
)
751+
;
636752
assert_false
637753
(
638754
respondsToLightDismiss
@@ -647,6 +763,24 @@
647763
'
648764
)
649765
;
766+
assert_false
767+
(
768+
respondsToLightDismiss2
769+
'
770+
Dialog
771+
should
772+
NOT
773+
respond
774+
to
775+
light
776+
dismiss
777+
(
778+
:
779+
open
780+
)
781+
'
782+
)
783+
;
650784
break
651785
;
652786
case
@@ -669,6 +803,23 @@
669803
;
670804
assert_false
671805
(
806+
respondsToEsc2
807+
'
808+
Dialog
809+
should
810+
NOT
811+
respond
812+
to
813+
ESC
814+
(
815+
:
816+
open
817+
)
818+
'
819+
)
820+
;
821+
assert_false
822+
(
672823
respondsToLightDismiss
673824
'
674825
Dialog
@@ -681,6 +832,24 @@
681832
'
682833
)
683834
;
835+
assert_false
836+
(
837+
respondsToLightDismiss2
838+
'
839+
Dialog
840+
should
841+
NOT
842+
respond
843+
to
844+
light
845+
dismiss
846+
(
847+
:
848+
open
849+
)
850+
'
851+
)
852+
;
684853
break
685854
;
686855
case

0 commit comments

Comments
 (0)