def MeasurePage(self, page, tab, results): # In current telemetry tests, all tests wait for DocumentComplete state, # but we need to wait for the load event. tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to # recognize loading as a toplevel action. self._timeline_metric.Stop(page, tab) loading.LoadingMetric().AddResults(tab, results) self._timeline_metric.AddResults(tab, results)
def MeasurePage(self, page, tab, results): # In current telemetry tests, all tests wait for DocumentComplete state, # but we need to wait for the load event. def IsLoaded(): return bool( tab.EvaluateJavaScript('performance.timing.loadEventStart')) util.WaitFor(IsLoaded, 300) # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to # recognize loading as a toplevel action. self._metrics.Stop(tab) loading.LoadingMetric().AddResults(tab, results) self._metrics.AddResults(results)
def MeasurePage(self, page, tab, results): # In current telemetry tests, all tests wait for DocumentComplete state, # but we need to wait for the load event. tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) profile_files = tab.browser.StopProfiling() loading.LoadingMetric().AddResults(tab, results) profile_file = None for profile_file in profile_files: if 'renderer' in profile_file: break for function, period in perf_profiler.PerfProfiler.GetTopSamples( profile_file, 10).iteritems(): results.Add(function.replace('.', '_'), 'period', period)
def MeasurePage(self, page, tab, results): # In current telemetry tests, all tests wait for DocumentComplete state, # but we need to wait for the load event. tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to # recognize loading as a toplevel action. self._timeline_controller.Stop(tab) loading.LoadingMetric().AddResults(tab, results) timeline_metric = timeline.LoadTimesTimelineMetric() renderer_thread = \ self._timeline_controller.model.GetRendererThreadFromTab(tab) record = tir_module.TimelineInteractionRecord( "loading_trace_interaction", 0, float('inf')) timeline_metric.AddResults(self._timeline_controller.model, renderer_thread, [record], results)
def MeasurePage(self, page, tab, results): rendering_stats_deltas = self._metrics.deltas if not (rendering_stats_deltas['numFramesSentToScreen'] > 0): raise DidNotScrollException() loading.LoadingMetric().AddResults(tab, results) smoothness.CalcFirstPaintTimeResults(results, tab) benchmark_stats = GpuRenderingStats(rendering_stats_deltas) smoothness.CalcResults(benchmark_stats, results) if self.options.report_all_results: for k, v in rendering_stats_deltas.iteritems(): results.Add(k, '', v) if tab.browser.platform.IsRawDisplayFrameRateSupported(): for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): if r.value is None: raise MissingDisplayFrameRate(r.name) results.Add(r.name, r.unit, r.value)
def MeasurePage(self, page, tab, results): # Wait for the load event. tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) loading.LoadingMetric().AddResults(tab, results)