File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,10 +130,6 @@ function run(workerData) {
130130 // eslint-disable-next-line no-undef
131131 add_completion_callback ( ( _ , status ) => {
132132 clearTimeout ( timeout ) ;
133- // Match WPT semantics: exceptions thrown after done() do not fail the
134- // test. This also replaces the reporting handler of the process backend.
135- process . removeAllListeners ( 'uncaughtException' ) ;
136- process . on ( 'uncaughtException' , ( ) => { } ) ;
137133 send ( {
138134 type : 'completion' ,
139135 status,
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const assert = require ( 'assert' ) ;
4+ const { basename } = require ( 'path' ) ;
35const { WPTRunner } = require ( '../common/wpt' ) ;
46
57const runner = new WPTRunner ( 'html/webappapis/timers' , { concurrency : 1 } ) ;
68
9+ runner . setScriptModifier ( ( script ) => {
10+ if ( ! [ 'type-long-settimeout.any.js' , 'type-long-setinterval.any.js' ]
11+ . includes ( basename ( script . filename ) ) ) return ;
12+
13+ // Cancel the failure timer when the test completes so it cannot throw
14+ // while the runner is still processing the completion message.
15+ const failureTimer = 'setTimeout(assert_unreached, 100);' ;
16+ assert ( script . code . includes ( failureTimer ) , `Unexpected contents of ${ script . filename } ` ) ;
17+ script . code = script . code . replace ( failureTimer ,
18+ 'const failureTimer = setTimeout(assert_unreached, 100);\n' +
19+ 'add_completion_callback(() => clearTimeout(failureTimer));' ) ;
20+ } ) ;
21+
722runner . runJsTests ( ) ;
You can’t perform that action at this time.
0 commit comments