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

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

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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
« no previous file with comments | « tools/perf/metrics/timeline.py ('k') | tools/perf/metrics/webrtc_stats.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 telemetry.timeline import model as model_module
8 from telemetry.unittest_util import test_page_test_results
9 from telemetry.web_perf import timeline_interaction_record as tir_module
10
7 from metrics import timeline 11 from metrics import timeline
8 from telemetry.unittest_util import test_page_test_results 12
9 from telemetry.timeline import model as model_module
10 from telemetry.web_perf import timeline_interaction_record as tir_module
11 13
12 def _GetInteractionRecord(start, end): 14 def _GetInteractionRecord(start, end):
13 return tir_module.TimelineInteractionRecord("test-record", start, end) 15 return tir_module.TimelineInteractionRecord("test-record", start, end)
14 16
15 17
16 class LoadTimesTimelineMetric(unittest.TestCase): 18 class LoadTimesTimelineMetric(unittest.TestCase):
17 def GetResults(self, metric, model, renderer_thread, interaction_records): 19 def GetResults(self, metric, model, renderer_thread, interaction_records):
18 results = test_page_test_results.TestPageTestResults(self) 20 results = test_page_test_results.TestPageTestResults(self)
19 metric.AddResults(model, renderer_thread, interaction_records, results) 21 metric.AddResults(model, renderer_thread, interaction_records, results)
20 return results 22 return results
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 metric.details_to_report = timeline.ReportMainThreadOnly 180 metric.details_to_report = timeline.ReportMainThreadOnly
179 results = self.GetResults(metric, model, renderer_main.parent, 181 results = self.GetResults(metric, model, renderer_main.parent,
180 [_GetInteractionRecord(10, 30)]) 182 [_GetInteractionRecord(10, 30)])
181 183
182 # Test a couple specific results. 184 # Test a couple specific results.
183 assert_results = { 185 assert_results = {
184 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0, 186 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0,
185 } 187 }
186 for name, value in assert_results.iteritems(): 188 for name, value in assert_results.iteritems():
187 results.AssertHasPageSpecificScalarValue(name, 'ms', value) 189 results.AssertHasPageSpecificScalarValue(name, 'ms', value)
OLDNEW
« no previous file with comments | « tools/perf/metrics/timeline.py ('k') | tools/perf/metrics/webrtc_stats.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698