#NEWLINE# def update_result( self , context ) : #NEWLINE# #INDENT# self . device . execute ( 'am force-stop {}' . format ( self . browser_package ) ) #NEWLINE# if self . with_audio : #NEWLINE# #INDENT# self . device . execute ( 'am force-stop com.android.music' ) #NEWLINE# #UNINDENT# indexfile = os . path . join ( self . device . working_directory , 'bbench/index_noinput.html' ) #NEWLINE# self . device . pull_file ( indexfile , context . output_directory ) #NEWLINE# output_file = os . path . join ( self . device . working_directory , 'browser_bbench_logcat.txt' ) #NEWLINE# self . device . execute ( 'logcat -v time -d > {}' . format ( output_file ) ) #NEWLINE# self . device . pull_file ( output_file , context . output_directory ) #NEWLINE# metrics = _parse_metrics ( os . path . join ( context . output_directory , 'browser_bbench_logcat.txt' ) , os . path . join ( context . output_directory , 'index_noinput.html' ) , context . output_directory ) #NEWLINE# for ( key , values ) in metrics : #NEWLINE# #INDENT# for ( i , value ) in enumerate ( values ) : #NEWLINE# #INDENT# metric = ( '{}_{}' . format ( key , i ) if i else key ) #NEWLINE# context . result . add_metric ( metric , value , units = 'ms' , lower_is_better = True )