File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ test ( t => {
2+ const c = new AbortController ( ) ,
3+ s = c . signal ;
4+ let state = "begin" ;
5+
6+ assert_false ( s . aborted ) ;
7+
8+ s . addEventListener ( "abort" ,
9+ t . step_func ( e => {
10+ assert_equals ( state , "begin" ) ;
11+ state = "aborted" ;
12+ } )
13+ ) ;
14+ c . abort ( ) ;
15+
16+ assert_equals ( state , "aborted" ) ;
17+ assert_true ( s . aborted ) ;
18+
19+ c . abort ( ) ;
20+ } , "AbortController() basics" ) ;
21+
22+ done ( ) ;
Original file line number Diff line number Diff line change 1515 "Event" ,
1616 "CustomEvent" ,
1717 "EventTarget" ,
18+ "AbortController" ,
19+ "AbortSignal" ,
1820 "Node" ,
1921 "Document" ,
2022 "DOMImplementation" ,
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ <h1>DOM IDL tests</h1>
2424 EventTarget : [ 'new EventTarget()' ] ,
2525 Event : [ 'document.createEvent("Event")' , 'new Event("foo")' ] ,
2626 CustomEvent : [ 'new CustomEvent("foo")' ] ,
27+ AbortController : [ 'new AbortController()' ] ,
28+ AbortSignal : [ 'new AbortController().signal' ] ,
2729 Document : [ 'new Document()' ] ,
2830 XMLDocument : [ 'xmlDoc' ] ,
2931 DOMImplementation : [ 'document.implementation' ] ,
Original file line number Diff line number Diff line change @@ -61,6 +61,23 @@ dictionary EventListenerOptions {
6161};
6262
6363
64+ [Constructor,
65+ Exposed=(Window,Worker)]
66+ interface AbortController {
67+ [SameObject] readonly attribute AbortSignal signal;
68+
69+ void abort();
70+ };
71+
72+
73+ [Exposed=(Window,Worker)]
74+ interface AbortSignal : EventTarget {
75+ readonly attribute boolean aborted;
76+
77+ attribute EventHandler onabort;
78+ };
79+
80+
6481[NoInterfaceObject,
6582 Exposed=Window]
6683interface NonElementParentNode {
You can’t perform that action at this time.
0 commit comments