@@ -477,11 +477,11 @@ export class RecorderController extends LitElement {
477477 if ( this . viewDescriptor ) {
478478 this . viewDescriptor = undefined ;
479479 }
480- if ( event . data . extension ) {
481- return await this . #onPlayViaExtension( event . data . extension ) ;
480+ if ( event . extension ) {
481+ return await this . #onPlayViaExtension( event . extension ) ;
482482 }
483483 Host . userMetrics . recordingReplayStarted (
484- event . data . targetPanel !== Components . RecordingView . TargetPanel . DEFAULT ?
484+ event . targetPanel !== Components . RecordingView . TargetPanel . DEFAULT ?
485485 Host . UserMetrics . RecordingReplayStarted . REPLAY_WITH_PERFORMANCE_TRACING :
486486 Host . UserMetrics . RecordingReplayStarted . REPLAY_ONLY ) ;
487487 this . #replayState. isPlaying = true ;
@@ -494,9 +494,9 @@ export class RecorderController extends LitElement {
494494 await this . #disableDeviceModeIfEnabled( ) ;
495495
496496 this . recordingPlayer = new Models . RecordingPlayer . RecordingPlayer (
497- this . currentRecording . flow , { speed : event . data . speed , breakpointIndexes : this . #stepBreakpointIndexes} ) ;
497+ this . currentRecording . flow , { speed : event . speed , breakpointIndexes : this . #stepBreakpointIndexes} ) ;
498498
499- const withPerformanceTrace = event . data . targetPanel === Components . RecordingView . TargetPanel . PERFORMANCE_PANEL ;
499+ const withPerformanceTrace = event . targetPanel === Components . RecordingView . TargetPanel . PERFORMANCE_PANEL ;
500500 const sectionsWithScreenshot = new Set ( ) ;
501501 this . recordingPlayer . addEventListener ( Models . RecordingPlayer . Events . STEP , async ( { data : { step, resolve} } ) => {
502502 this . currentStep = step ;
@@ -565,7 +565,7 @@ export class RecorderController extends LitElement {
565565 } ) ;
566566
567567 let performanceTracing = null ;
568- switch ( event . data ?. targetPanel ) {
568+ switch ( event . targetPanel ) {
569569 case Components . RecordingView . TargetPanel . PERFORMANCE_PANEL :
570570 performanceTracing = new Tracing . PerformanceTracing . PerformanceTracing ( this . #getMainTarget( ) , {
571571 tracingBufferUsage ( ) : void { } ,
@@ -590,8 +590,8 @@ export class RecorderController extends LitElement {
590590 const events = await eventsPromise ;
591591 this . #replayState. isPlaying = false ;
592592 this . recordingPlayer = undefined ;
593- await UI . InspectorView . InspectorView . instance ( ) . showPanel ( event . data ?. targetPanel as string ) ;
594- if ( event . data ?. targetPanel === Components . RecordingView . TargetPanel . PERFORMANCE_PANEL ) {
593+ await UI . InspectorView . InspectorView . instance ( ) . showPanel ( event . targetPanel as string ) ;
594+ if ( event . targetPanel === Components . RecordingView . TargetPanel . PERFORMANCE_PANEL ) {
595595 // Note: this is not passing any metadata to the Performance panel.
596596 const trace = new SDK . TraceObject . TraceObject ( events as Trace . Types . Events . Event [ ] ) ;
597597 void Common . Revealer . reveal ( trace ) ;
@@ -700,12 +700,12 @@ export class RecorderController extends LitElement {
700700 { keepBreakpoints : true , updateSession : true } ) ;
701701 }
702702
703- async #handleRecordingTitleChanged( event : Components . RecordingView . RecordingTitleChangedEvent ) : Promise < void > {
703+ async #handleRecordingTitleChanged( title : string ) : Promise < void > {
704704 if ( ! this . currentRecording ) {
705705 throw new Error ( 'Current recording expected to be defined.' ) ;
706706 }
707707
708- const flow = { ...this . currentRecording . flow , title : event . title } ;
708+ const flow = { ...this . currentRecording . flow , title} ;
709709 this . #setCurrentRecording( await this . #storage. updateRecording ( this . currentRecording . storageName , flow ) ) ;
710710 }
711711
@@ -737,7 +737,7 @@ export class RecorderController extends LitElement {
737737 { keepBreakpoints : true , updateSession : true } ) ;
738738 }
739739
740- async #onNetworkConditionsChanged( event : Components . RecordingView . NetworkConditionsChanged ) : Promise < void > {
740+ async #onNetworkConditionsChanged( data ?: SDK . NetworkManager . Conditions ) : Promise < void > {
741741 if ( ! this . currentRecording ) {
742742 throw new Error ( 'Current recording expected to be defined.' ) ;
743743 }
@@ -751,7 +751,7 @@ export class RecorderController extends LitElement {
751751 }
752752 return step . type === 'emulateNetworkConditions' ;
753753 } ) ;
754- if ( ! event . data ) {
754+ if ( ! data ) {
755755 // Delete step if present.
756756 if ( emulateNetworkConditionsIdx !== - 1 ) {
757757 this . currentRecording . flow . steps . splice ( emulateNetworkConditionsIdx , 1 ) ;
@@ -761,24 +761,24 @@ export class RecorderController extends LitElement {
761761 this . currentRecording . flow . steps . splice (
762762 0 , 0 ,
763763 Models . SchemaUtils . createEmulateNetworkConditionsStep (
764- { download : event . data . download , upload : event . data . upload , latency : event . data . latency } ) ) ;
764+ { download : data . download , upload : data . upload , latency : data . latency } ) ) ;
765765 } else {
766766 // Update existing step.
767767 const step =
768768 this . currentRecording . flow . steps [ emulateNetworkConditionsIdx ] as Models . Schema . EmulateNetworkConditionsStep ;
769- step . download = event . data . download ;
770- step . upload = event . data . upload ;
771- step . latency = event . data . latency ;
769+ step . download = data . download ;
770+ step . upload = data . upload ;
771+ step . latency = data . latency ;
772772 }
773773 this . #setCurrentRecording(
774774 await this . #storage. updateRecording ( this . currentRecording . storageName , this . currentRecording . flow ) ) ;
775775 }
776776
777- async #onTimeoutChanged( event : Components . RecordingView . TimeoutChanged ) : Promise < void > {
777+ async #onTimeoutChanged( timeout ?: number ) : Promise < void > {
778778 if ( ! this . currentRecording ) {
779779 throw new Error ( 'Current recording expected to be defined.' ) ;
780780 }
781- this . currentRecording . flow . timeout = event . data ;
781+ this . currentRecording . flow . timeout = timeout ;
782782 this . #setCurrentRecording(
783783 await this . #storage. updateRecording ( this . currentRecording . storageName , this . currentRecording . flow ) ) ;
784784 }
@@ -1033,8 +1033,8 @@ export class RecorderController extends LitElement {
10331033
10341034 async #onPlayRecordingByName( event : Components . RecordingListView . PlayRecordingEvent ) : Promise < void > {
10351035 await this . #onRecordingSelected( event ) ;
1036- await this . #onPlayRecording( new Components . RecordingView . PlayRecordingEvent (
1037- { targetPanel : Components . RecordingView . TargetPanel . DEFAULT , speed : this . #recorderSettings. speed } ) ) ;
1036+ await this . #onPlayRecording(
1037+ { targetPanel : Components . RecordingView . TargetPanel . DEFAULT , speed : this . #recorderSettings. speed } ) ;
10381038 }
10391039
10401040 #onAddBreakpoint = ( event : AddBreakpointEvent ) : void => {
@@ -1083,8 +1083,8 @@ export class RecorderController extends LitElement {
10831083 return ;
10841084
10851085 case Actions . RecorderActions . REPLAY_RECORDING :
1086- void this . #onPlayRecording( new Components . RecordingView . PlayRecordingEvent (
1087- { targetPanel : Components . RecordingView . TargetPanel . DEFAULT , speed : this . #recorderSettings. speed } ) ) ;
1086+ void this . #onPlayRecording(
1087+ { targetPanel : Components . RecordingView . TargetPanel . DEFAULT , speed : this . #recorderSettings. speed } ) ;
10881088 return ;
10891089
10901090 case Actions . RecorderActions . TOGGLE_CODE_VIEW : {
@@ -1210,25 +1210,25 @@ export class RecorderController extends LitElement {
12101210 extensionConverters : this . extensionConverters ,
12111211 replayExtensions : this . replayExtensions ,
12121212 extensionDescriptor : this . viewDescriptor ,
1213+ recordingFinished : this . #onRecordingFinished. bind ( this ) ,
1214+ addAssertion : this . #handleAddAssertionEvent. bind ( this ) ,
1215+ abortReplay : this . #onAbortReplay. bind ( this ) ,
1216+ playRecording : this . #onPlayRecording. bind ( this ) ,
1217+ networkConditionsChanged : this . #onNetworkConditionsChanged. bind ( this ) ,
1218+ timeoutChanged : this . #onTimeoutChanged. bind ( this ) ,
1219+ titleChanged : this . #handleRecordingTitleChanged. bind ( this ) ,
12131220 } ) }
1214- @networkconditionschanged =${ this . #onNetworkConditionsChanged}
1215- @timeoutchanged=${ this . #onTimeoutChanged}
12161221 @requestselectorattribute =${ (
12171222 event : Controllers . SelectorPicker . RequestSelectorAttributeEvent ,
12181223 ) => {
12191224 event . send ( this . currentRecording ?. flow . selectorAttribute ) ;
12201225 } }
1221- @recordingfinished=${ this . #onRecordingFinished}
12221226 @stepchanged=${ this . #handleRecordingChanged. bind ( this ) }
1223- @recordingtitlechanged=${ this . #handleRecordingTitleChanged. bind ( this ) }
12241227 @addstep=${ this . #handleStepAdded. bind ( this ) }
12251228 @removestep=${ this . #handleStepRemoved. bind ( this ) }
12261229 @addbreakpoint=${ this . #onAddBreakpoint. bind ( this ) }
12271230 @removebreakpoint=${ this . #onRemoveBreakpoint. bind ( this ) }
1228- @playrecording=${ this . #onPlayRecording. bind ( this ) }
1229- @abortreplay=${ this . #onAbortReplay. bind ( this ) }
12301231 @recorderextensionviewclosed=${ this . #onExtensionViewClosed. bind ( this ) }
1231- @addassertion=${ this . #handleAddAssertionEvent. bind ( this ) }
12321232 ${ UI . Widget . widgetRef ( Components . RecordingView . RecordingView , widget => { this . #recordingView = widget ; } ) }
12331233 > </ devtools-widget >
12341234 ` ;
0 commit comments