Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: tools/perf/metrics/smoothness_unittest.py

Issue 16213002: Add telemetry to track the time an event spent waiting for the main thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import unittest 4 import unittest
5 5
6 from metrics import smoothness 6 from metrics import smoothness
7 from metrics.gpu_rendering_stats import GpuRenderingStats 7 from metrics.gpu_rendering_stats import GpuRenderingStats
8 from telemetry.page import page 8 from telemetry.page import page
9 from telemetry.page.page_measurement_results import PageMeasurementResults 9 from telemetry.page.page_measurement_results import PageMeasurementResults
10 10
(...skipping 19 matching lines...) Expand all
30 'totalTilesAnalyzed': 160, 30 'totalTilesAnalyzed': 160,
31 'totalTileAnalysisTimeInSeconds': 1.6, 31 'totalTileAnalysisTimeInSeconds': 1.6,
32 'solidColorTilesAnalyzed': 40, 32 'solidColorTilesAnalyzed': 40,
33 'inputEventCount': 170, 33 'inputEventCount': 170,
34 'totalInputLatency': 1.7, 34 'totalInputLatency': 1.7,
35 'touchUICount': 180, 35 'touchUICount': 180,
36 'totalTouchUILatency': 1.8, 36 'totalTouchUILatency': 1.8,
37 'touchAckedCount': 190, 37 'touchAckedCount': 190,
38 'totalTouchAckedLatency': 1.9, 38 'totalTouchAckedLatency': 1.9,
39 'scrollUpdateCount': 200, 39 'scrollUpdateCount': 200,
40 'totalScrollUpdateLatency': 2.0} 40 'totalScrollUpdateLatency': 2.0,
41 'implToMainTouchEventCount': 100,
42 'totalImplToMainTouchEventLatency': 0.7,
43 'implToMainGestureScrollEventCount': 133,
44 'totalImplToMainGestureScrollEventLatency': 2.7}
41 stats = GpuRenderingStats(mock_rendering_stats_deltas) 45 stats = GpuRenderingStats(mock_rendering_stats_deltas)
42 46
43 res = PageMeasurementResults() 47 res = PageMeasurementResults()
44 res.WillMeasurePage(page.Page('http://foo.com/', None)) 48 res.WillMeasurePage(page.Page('http://foo.com/', None))
45 smoothness.CalcResults(stats, res) 49 smoothness.CalcResults(stats, res)
46 res.DidMeasurePage() 50 res.DidMeasurePage()
47 51
48 # Scroll Results 52 # Scroll Results
49 self.assertAlmostEquals( 53 self.assertAlmostEquals(
50 1.0 / 100.0 * 1000.0, 54 1.0 / 100.0 * 1000.0,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 res.page_results[0]['average_latency'].value) 108 res.page_results[0]['average_latency'].value)
105 self.assertAlmostEquals( 109 self.assertAlmostEquals(
106 1.8 / 180.0 * 1000.0, 110 1.8 / 180.0 * 1000.0,
107 res.page_results[0]['average_touch_ui_latency'].value) 111 res.page_results[0]['average_touch_ui_latency'].value)
108 self.assertAlmostEquals( 112 self.assertAlmostEquals(
109 1.9 / 190.0 * 1000.0, 113 1.9 / 190.0 * 1000.0,
110 res.page_results[0]['average_touch_acked_latency'].value) 114 res.page_results[0]['average_touch_acked_latency'].value)
111 self.assertAlmostEquals( 115 self.assertAlmostEquals(
112 2.0 / 200.0 * 1000.0, 116 2.0 / 200.0 * 1000.0,
113 res.page_results[0]['average_scroll_update_latency'].value) 117 res.page_results[0]['average_scroll_update_latency'].value)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698