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

Side by Side Diff: tools/perf/measurements/gpu_times_unittest.py

Issue 854833003: Added GPU performance metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed gpu_device check in gpu_times_unittest Created 5 years, 11 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
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from measurements import gpu_times
5 from metrics import gpu_timeline
6 from telemetry import decorators
7 from telemetry.core import wpr_modes
8 from telemetry.unittest_util import options_for_unittests
9 from telemetry.unittest_util import page_test_test_case
10
11
12 class GPUTimesUnitTest(page_test_test_case.PageTestTestCase):
13 def setUp(self):
14 self._options = options_for_unittests.GetCopy()
15 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
16
17 def _testResultNameExists(self, results, name):
18 self.assertEquals(len(results.FindAllPageSpecificValuesNamed(
19 name + '_max')), 1, msg='Could not find value: %s_max' % name)
20 self.assertEquals(len(results.FindAllPageSpecificValuesNamed(
21 name + '_avg')), 1, msg='Could not find value: %s_avg' % name)
22 self.assertEquals(len(results.FindAllPageSpecificValuesNamed(
23 name + '_stddev')), 1, msg='Could not find value: %s_stddev' % name)
24
25 def _testGPUResultNameExists(self, results, name):
26 self._testResultNameExists(results, name + "_service")
27
28 def testBasic(self):
29 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
30 measurement = gpu_times.GPUTimes()
31 timeline_options = self._options
32 results = self.RunMeasurement(measurement, ps, options = timeline_options)
33 self.assertEquals(0, len(results.failures))
34
35 self._testResultNameExists(results, 'total_frame')
36 self._testGPUResultNameExists(results, 'total_gpu')
37 for name in gpu_timeline.TRACKED_NAMES.itervalues():
38 self._testGPUResultNameExists(results, name)
39
40 def testCleanUpTrace(self):
41 self.TestTracingCleanedUp(gpu_times.GPUTimes, self._options)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698