File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ describeWithEnvironment('getNonResolvedURL', () => {
2525 assert . strictEqual ( url , profileCall . callFrame . url ) ;
2626 } ) ;
2727
28+ it ( 'parses out the URL For a ParseAuthorStyleSheet' , async function ( ) {
29+ const { parsedTrace} = await TraceLoader . traceEngine ( this , 'web-dev-with-commit.json.gz' ) ;
30+ const parseStyle = parsedTrace . Renderer . allTraceEntries . find ( Trace . Types . Events . isParseAuthorStyleSheetEvent ) ;
31+ assert . isOk ( parseStyle ) ;
32+ const url = Trace . Handlers . Helpers . getNonResolvedURL ( parseStyle , parsedTrace ) ;
33+ assert . strictEqual ( url , parseStyle . args ?. data . url ) ;
34+ } ) ;
35+
2836 it ( 'uses the request URL for a network request' , async function ( ) {
2937 const { parsedTrace} = await TraceLoader . traceEngine ( this , 'web-dev-with-commit.json.gz' ) ;
3038 const request = parsedTrace . NetworkRequests . byTime [ 0 ] ;
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ export function getNonResolvedURL(
4545 return entry . args . data . url as Platform . DevToolsPath . UrlString ;
4646 }
4747
48+ if ( Types . Events . isParseAuthorStyleSheetEvent ( entry ) && entry . args ) {
49+ return entry . args . data . stylesheetUrl as Platform . DevToolsPath . UrlString ;
50+ }
51+
4852 if ( entry . args ?. data ?. stackTrace && entry . args . data . stackTrace . length > 0 ) {
4953 return entry . args . data . stackTrace [ 0 ] . url as Platform . DevToolsPath . UrlString ;
5054 }
Original file line number Diff line number Diff line change @@ -2840,6 +2840,19 @@ export function isFlowPhaseEvent(event: Event): event is FlowEvent {
28402840 return event . ph === Phase . FLOW_START || event . ph === Phase . FLOW_STEP || event . ph === Phase . FLOW_END ;
28412841}
28422842
2843+ export interface ParseAuthorStyleSheet extends Complete {
2844+ name : Name . PARSE_AUTHOR_STYLE_SHEET ;
2845+ args ?: Args & {
2846+ data : {
2847+ stylesheetUrl : string ,
2848+ } ,
2849+ } ;
2850+ }
2851+
2852+ export function isParseAuthorStyleSheetEvent ( event : Event ) : event is ParseAuthorStyleSheet {
2853+ return event . name === Name . PARSE_AUTHOR_STYLE_SHEET ;
2854+ }
2855+
28432856/**
28442857 * This is an exhaustive list of events we track in the Performance
28452858 * panel. Note not all of them are necessarliry shown in the flame
You can’t perform that action at this time.
0 commit comments