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

Unified Diff: tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py

Issue 1033733010: Adding checkerboard measurements to telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using a single enum string instead of separate ones. Improving readability. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py
diff --git a/tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py b/tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py
index 0c35a4018d617d23264b6d04b07675905f01ad0a..7f78bd57e9089f7a11b7d28ba1ddd6c3a9bbbe55 100644
--- a/tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py
+++ b/tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py
@@ -54,11 +54,13 @@ class ReferenceRenderingStats(object):
self.frame_timestamps = []
self.frame_times = []
self.approximated_pixel_percentages = []
+ self.checkerboarded_pixel_percentages = []
def AppendNewRange(self):
self.frame_timestamps.append([])
self.frame_times.append([])
self.approximated_pixel_percentages.append([])
+ self.checkerboarded_pixel_percentages.append([])
class ReferenceInputLatencyStats(object):
@@ -142,7 +144,8 @@ def AddImplThreadRenderingStats(mock_timer, thread, first_frame,
# Create randonm data and timestap for impl thread rendering stats.
data = {'frame_count': 1,
'visible_content_area': random.uniform(0, 100),
- 'approximated_visible_content_area': random.uniform(0, 5)}
+ 'approximated_visible_content_area': random.uniform(0, 5),
+ 'checkerboarded_visible_content_area': random.uniform(0, 5)}
timestamp = mock_timer.AdvanceAndGet()
# Add a slice with the event data to the given thread.
@@ -167,6 +170,9 @@ def AddImplThreadRenderingStats(mock_timer, thread, first_frame,
round(DivideIfPossibleOrZero(data['approximated_visible_content_area'],
data['visible_content_area']) * 100.0, 3))
+ ref_stats.checkerboarded_pixel_percentages[-1].append(
+ round(DivideIfPossibleOrZero(data['checkerboarded_visible_content_area'],
+ data['visible_content_area']) * 100.0, 3))
def AddInputLatencyStats(mock_timer, start_thread, end_thread,
ref_latency_stats=None):
@@ -462,6 +468,8 @@ class RenderingStatsUnitTest(unittest.TestCase):
self.assertEquals(stats.frame_times, browser_ref_stats.frame_times)
self.assertEquals(stats.approximated_pixel_percentages,
renderer_ref_stats.approximated_pixel_percentages)
+ self.assertEquals(stats.checkerboarded_pixel_percentages,
+ renderer_ref_stats.checkerboarded_pixel_percentages)
def testInputLatencyFromTimeline(self):
timeline = model.TimelineModel()

Powered by Google App Engine
This is Rietveld 408576698