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

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

Issue 332213003: Move telemetry/core/timeline and timeline_data to telemetry/timeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
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 4
5 import unittest 5 import unittest
6 6
7 from metrics import test_page_measurement_results 7 from metrics import test_page_measurement_results
8 from metrics import timeline 8 from metrics import timeline
9 from telemetry.core.timeline import model as model_module 9 from telemetry.timeline import model as model_module
10 from telemetry.web_perf import timeline_interaction_record as tir_module 10 from telemetry.web_perf import timeline_interaction_record as tir_module
11 11
12 def _GetInteractionRecord(start, end): 12 def _GetInteractionRecord(start, end):
13 return tir_module.TimelineInteractionRecord("test-record", start, end) 13 return tir_module.TimelineInteractionRecord("test-record", start, end)
14 14
15 15
16 class LoadTimesTimelineMetric(unittest.TestCase): 16 class LoadTimesTimelineMetric(unittest.TestCase):
17 def GetResults(self, metric, model, renderer_thread, interaction_records): 17 def GetResults(self, metric, model, renderer_thread, interaction_records):
18 results = test_page_measurement_results.TestPageMeasurementResults(self) 18 results = test_page_measurement_results.TestPageMeasurementResults(self)
19 metric.AddResults(model, renderer_thread, interaction_records, results) 19 metric.AddResults(model, renderer_thread, interaction_records, results)
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 metric.details_to_report = timeline.ReportMainThreadOnly 175 metric.details_to_report = timeline.ReportMainThreadOnly
176 results = self.GetResults(metric, model, renderer_main.parent, 176 results = self.GetResults(metric, model, renderer_main.parent,
177 [_GetInteractionRecord(10, 30)]) 177 [_GetInteractionRecord(10, 30)])
178 178
179 # Test a couple specific results. 179 # Test a couple specific results.
180 assert_results = { 180 assert_results = {
181 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0, 181 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0,
182 } 182 }
183 for name, value in assert_results.iteritems(): 183 for name, value in assert_results.iteritems():
184 results.AssertHasPageSpecificScalarValue(name, 'ms', value) 184 results.AssertHasPageSpecificScalarValue(name, 'ms', value)
OLDNEW
« no previous file with comments | « tools/perf/metrics/speedindex_unittest.py ('k') | tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698