@@ -57,9 +57,9 @@ class GatherRunner {
5757 return driver . gotoURL ( 'about:blank' )
5858 // Wait a bit for about:blank to "take hold" before switching back to the page.
5959 . then ( _ => new Promise ( ( resolve , reject ) => setTimeout ( resolve , 300 ) ) )
60- // Begin tracing if required .
60+ // Begin tracing only if requested by config .
6161 . then ( _ => options . config . trace && driver . beginTrace ( ) )
62- // Begin network recording .
62+ // Network is always recorded for internal use, even if not saved as artifact .
6363 . then ( _ => driver . beginNetworkCollect ( options ) )
6464 // Navigate.
6565 . then ( _ => driver . gotoURL ( options . url , {
@@ -136,7 +136,7 @@ class GatherRunner {
136136 const driver = options . driver ;
137137 const config = options . config ;
138138 const gatherers = config . gatherers ;
139- const loadData = { } ;
139+ const passData = { } ;
140140
141141 let pass = Promise . resolve ( ) ;
142142
@@ -148,9 +148,8 @@ class GatherRunner {
148148 // Before Chrome 54.0.2816 (codereview.chromium.org/2161583004),
149149 // traceContents was an array of trace events; after, traceContents is
150150 // an object with a traceEvents property. Normalize to object form.
151- loadData . trace = Array . isArray ( traceContents ) ? {
152- traceEvents : traceContents
153- } : traceContents ;
151+ passData . trace = Array . isArray ( traceContents ) ?
152+ { traceEvents : traceContents } : traceContents ;
154153 log . verbose ( 'statusEnd' , 'Retrieving trace' ) ;
155154 } ) ;
156155 }
@@ -161,23 +160,23 @@ class GatherRunner {
161160 return driver . endNetworkCollect ( ) ;
162161 } ) . then ( networkRecords => {
163162 // Network records only given to gatherers if requested by config.
164- config . network && ( loadData . networkRecords = networkRecords ) ;
163+ config . network && ( passData . networkRecords = networkRecords ) ;
165164 log . verbose ( 'statusEnd' , status ) ;
166165 } ) ;
167166
168167 pass = gatherers . reduce ( ( chain , gatherer ) => {
169168 const status = `Retrieving: ${ gatherer . name } ` ;
170169 return chain . then ( _ => {
171170 log . log ( 'status' , status ) ;
172- return gatherer . afterPass ( options , loadData ) ;
171+ return gatherer . afterPass ( options , passData ) ;
173172 } ) . then ( ret => {
174173 log . verbose ( 'statusEnd' , status ) ;
175174 return ret ;
176175 } ) ;
177176 } , pass ) ;
178177
179178 // Resolve on tracing data using passName from config.
180- return pass . then ( _ => loadData ) ;
179+ return pass . then ( _ => passData ) ;
181180 }
182181
183182 static run ( passes , options ) {
0 commit comments