@@ -453,12 +453,19 @@ class WPTRunner {
453453 this . scriptsModifier = modifier ;
454454 }
455455
456- fullInitScript ( hasSubsetScript , locationSearchString ) {
456+ fullInitScript ( hasSubsetScript , locationSearchString , metaTitle , relativePath ) {
457457 let { initScript } = this ;
458- if ( hasSubsetScript || locationSearchString ) {
458+
459+ if ( hasSubsetScript || locationSearchString || ! metaTitle ) {
459460 initScript = `${ initScript } \n\n//===\nglobalThis.location ||= {};` ;
460461 }
461462
463+ if ( metaTitle ) {
464+ initScript = `${ initScript } \n\n//===\nglobalThis.META_TITLE = "${ metaTitle } ";` ;
465+ } else {
466+ initScript = `${ initScript } \n\n//===\nglobalThis.location.pathname = "/${ relativePath } ";` ;
467+ }
468+
462469 if ( locationSearchString ) {
463470 initScript = `${ initScript } \n\n//===\nglobalThis.location.search = "${ locationSearchString } ";` ;
464471 }
@@ -554,13 +561,17 @@ class WPTRunner {
554561 const harnessPath = fixtures . path ( 'wpt' , 'resources' , 'testharness.js' ) ;
555562 const scriptsToRun = [ ] ;
556563 let hasSubsetScript = false ;
564+ let needsGc = false ;
557565
558566 // Scripts specified with the `// META: script=` header
559567 if ( meta . script ) {
560568 for ( const script of meta . script ) {
561569 if ( script === '/common/subset-tests.js' || script === '/common/subset-tests-by-key.js' ) {
562570 hasSubsetScript = true ;
563571 }
572+ if ( script === '/common/gc.js' ) {
573+ needsGc = true ;
574+ }
564575 const obj = {
565576 filename : this . resource . toRealFilePath ( relativePath , script ) ,
566577 code : this . resource . read ( relativePath , script , false ) ,
@@ -592,12 +603,13 @@ class WPTRunner {
592603 testRelativePath : relativePath ,
593604 wptRunner : __filename ,
594605 wptPath : this . path ,
595- initScript : this . fullInitScript ( hasSubsetScript , variant ) ,
606+ initScript : this . fullInitScript ( hasSubsetScript , variant , meta . title , relativePath ) ,
596607 harness : {
597608 code : fs . readFileSync ( harnessPath , 'utf8' ) ,
598609 filename : harnessPath ,
599610 } ,
600611 scriptsToRun,
612+ needsGc,
601613 } ,
602614 } ) ;
603615 this . workers . set ( testFileName , worker ) ;
@@ -749,11 +761,7 @@ class WPTRunner {
749761 */
750762 resultCallback ( filename , test , reportResult ) {
751763 const status = this . getTestStatus ( test . status ) ;
752- const title = this . getTestTitle ( filename ) ;
753- if ( / ^ U n t i t l e d ( \d + ) ? $ / . test ( test . name ) ) {
754- test . name = `${ title } ${ test . name . slice ( 8 ) } ` ;
755- }
756- console . log ( `---- ${ title } ----` ) ;
764+ console . log ( `---- ${ test . name } ----` ) ;
757765 if ( status !== kPass ) {
758766 this . fail ( filename , test , status , reportResult ) ;
759767 } else {
0 commit comments