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

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

Issue 926833002: [Telemetry] Move gpu_timeline metrics to telemetry.web_perf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_test_results
8 from metrics import timeline 7 from metrics import timeline
8 from telemetry.unittest_util import test_page_test_results
9 from telemetry.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_test_results.TestPageTestResults(self) 18 results = test_page_test_results.TestPageTestResults(self)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 metric.details_to_report = timeline.ReportMainThreadOnly 178 metric.details_to_report = timeline.ReportMainThreadOnly
179 results = self.GetResults(metric, model, renderer_main.parent, 179 results = self.GetResults(metric, model, renderer_main.parent,
180 [_GetInteractionRecord(10, 30)]) 180 [_GetInteractionRecord(10, 30)])
181 181
182 # Test a couple specific results. 182 # Test a couple specific results.
183 assert_results = { 183 assert_results = {
184 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0, 184 timeline.ThreadCpuTimeResultName('renderer_main') : 9.0,
185 } 185 }
186 for name, value in assert_results.iteritems(): 186 for name, value in assert_results.iteritems():
187 results.AssertHasPageSpecificScalarValue(name, 'ms', value) 187 results.AssertHasPageSpecificScalarValue(name, 'ms', value)
OLDNEW
« no previous file with comments | « tools/perf/metrics/test_page_test_results.py ('k') | tools/telemetry/telemetry/unittest_util/test_page_test_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698