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

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

Issue 1217653003: Revert of [Telemetry] Modify CreatePageSet to CreateStorySet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/measurements/smoothness_unittest.py ('k') | tools/telemetry/telemetry/benchmark.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from telemetry.core import wpr_modes 5 from telemetry.core import wpr_modes
6 from telemetry import decorators 6 from telemetry import decorators
7 from telemetry.page import page 7 from telemetry.page import page
8 from telemetry.unittest_util import options_for_unittests 8 from telemetry.unittest_util import options_for_unittests
9 from telemetry.unittest_util import page_test_test_case 9 from telemetry.unittest_util import page_test_test_case
10 10
(...skipping 11 matching lines...) Expand all
22 action_runner.Wait(.2) 22 action_runner.Wait(.2)
23 23
24 24
25 class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase): 25 class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase):
26 def setUp(self): 26 def setUp(self):
27 self._options = options_for_unittests.GetCopy() 27 self._options = options_for_unittests.GetCopy()
28 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF 28 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
29 29
30 @decorators.Disabled('android') 30 @decorators.Disabled('android')
31 def testBasic(self): 31 def testBasic(self):
32 ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html') 32 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
33 measurement = thread_times.ThreadTimes() 33 measurement = thread_times.ThreadTimes()
34 timeline_options = self._options 34 timeline_options = self._options
35 results = self.RunMeasurement(measurement, ps, options = timeline_options) 35 results = self.RunMeasurement(measurement, ps, options = timeline_options)
36 self.assertFalse(len(results.failures), results.failures) 36 self.assertFalse(len(results.failures), results.failures)
37 37
38 for interval in timeline.IntervalNames: 38 for interval in timeline.IntervalNames:
39 for category in timeline.TimelineThreadCategories.values(): 39 for category in timeline.TimelineThreadCategories.values():
40 cpu_time_name = timeline.ThreadCpuTimeResultName(category, interval) 40 cpu_time_name = timeline.ThreadCpuTimeResultName(category, interval)
41 cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name) 41 cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name)
42 self.assertEquals(len(cpu_time), 1) 42 self.assertEquals(len(cpu_time), 1)
43 43
44 @decorators.Disabled('chromeos') # crbug.com/483212 44 @decorators.Disabled('chromeos') # crbug.com/483212
45 def testWithSilkDetails(self): 45 def testWithSilkDetails(self):
46 ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html') 46 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
47 measurement = thread_times.ThreadTimes(report_silk_details=True) 47 measurement = thread_times.ThreadTimes(report_silk_details=True)
48 results = self.RunMeasurement(measurement, ps, options = self._options) 48 results = self.RunMeasurement(measurement, ps, options = self._options)
49 self.assertEquals(0, len(results.failures)) 49 self.assertEquals(0, len(results.failures))
50 50
51 main_thread = "renderer_main" 51 main_thread = "renderer_main"
52 expected_trace_categories = ["blink", "cc", "idle"] 52 expected_trace_categories = ["blink", "cc", "idle"]
53 for interval in timeline.IntervalNames: 53 for interval in timeline.IntervalNames:
54 for trace_category in expected_trace_categories: 54 for trace_category in expected_trace_categories:
55 value_name = timeline.ThreadDetailResultName( 55 value_name = timeline.ThreadDetailResultName(
56 main_thread, interval, trace_category) 56 main_thread, interval, trace_category)
57 values = results.FindAllPageSpecificValuesNamed(value_name) 57 values = results.FindAllPageSpecificValuesNamed(value_name)
58 self.assertEquals(len(values), 1) 58 self.assertEquals(len(values), 1)
59 59
60 def testCleanUpTrace(self): 60 def testCleanUpTrace(self):
61 self.TestTracingCleanedUp(thread_times.ThreadTimes, self._options) 61 self.TestTracingCleanedUp(thread_times.ThreadTimes, self._options)
OLDNEW
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/telemetry/telemetry/benchmark.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698