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

Unified Diff: tools/perf/metrics/smoothness_unittest.py

Issue 27486002: Cleanup of page_measurement_results object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: keep on trying Created 7 years, 1 month 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/perf/metrics/smoothness_unittest.py
diff --git a/tools/perf/metrics/smoothness_unittest.py b/tools/perf/metrics/smoothness_unittest.py
index d1bcaeee2ad591bfdd439a55126e61f6b1443410..f1b1677debb78586e1d8d65165efc040d4add332 100644
--- a/tools/perf/metrics/smoothness_unittest.py
+++ b/tools/perf/metrics/smoothness_unittest.py
@@ -184,31 +184,39 @@ class SmoothnessMetricUnitTest(unittest.TestCase):
# Make a results object and add results to it from the smoothness metric.
results = PageMeasurementResults()
- results.WillMeasurePage(page.Page('http://foo.com/', None))
+ p0 = page.Page('http://foo.com/', None)
+ results.WillMeasurePage(p0)
smoothness_metric = smoothness.SmoothnessMetric(None)
smoothness_metric.SetStats(stats)
smoothness_metric.AddResults(None, results)
results.DidMeasurePage()
+ frame_times = results.FindPageSpecificValuesForPage(p0, 'frame_times')[0]
self.assertEquals(
expected_frame_times,
- results.page_results[0]['frame_times'].value)
+ frame_times.values)
+
+ mean_frame_time = results.FindPageSpecificValuesForPage(
+ p0, 'mean_frame_time')[0]
self.assertAlmostEquals(
1000.0 * (total_time_seconds / num_frames_sent),
- results.page_results[0]['mean_frame_time'].value,
+ mean_frame_time.value,
places=2)
# We don't verify the correctness of the discrepancy computation itself,
# because we have a separate unit test for that purpose.
+ jank = results.FindPageSpecificValuesForPage(p0, 'jank')[0]
self.assertAlmostEquals(
statistics.FrameDiscrepancy(stats.frame_timestamps, True),
- results.page_results[0]['jank'].value,
+ jank.value,
places=4)
# We do not verify the correctness of Percentile here; Percentile should
# have its own test.
# The 17 here represents a threshold of 17 ms; this should match the value
# in the smoothness metric.
+ mostly_smooth = results.FindPageSpecificValuesForPage(
+ p0, 'mostly_smooth')[0]
self.assertEquals(
statistics.Percentile(expected_frame_times, 95.0) < 17.0,
- results.page_results[0]['mostly_smooth'].value)
+ mostly_smooth.value)
« no previous file with comments | « tools/perf/measurements/page_cycler_unittest.py ('k') | tools/telemetry/telemetry/page/block_page_measurement_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698