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

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

Issue 2746533002: Revert of [Telemetry] Temporarily disable clock domain test. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import benchmark 5 from telemetry import benchmark
6 from telemetry.testing import tab_test_case 6 from telemetry.testing import tab_test_case
7 from telemetry.timeline import trace_data 7 from telemetry.timeline import trace_data
8 from telemetry.timeline import tracing_config 8 from telemetry.timeline import tracing_config
9 9
10 def GetSyncEvents(trace_part): 10 def GetSyncEvents(trace_part):
11 return [x for x in trace_part if x['ph'] == 'c'] 11 return [x for x in trace_part if x['ph'] == 'c']
12 12
13 class ClockDomainTest(tab_test_case.TabTestCase): 13 class ClockDomainTest(tab_test_case.TabTestCase):
14 14
15 # Don't run this test on Android; it's not supposed to work on Android 15 # Don't run this test on Android; it's not supposed to work on Android
16 # (since when doing Android tracing there are two different devices, 16 # (since when doing Android tracing there are two different devices,
17 # so the clock domains will be different) 17 # so the clock domains will be different)
18 # TODO(rnephew): Revert change from android to all once 18 @benchmark.Disabled('android')
19 # https://codereview.chromium.org/2741533003/ lands.
20 @benchmark.Disabled('all')
21 def testTelemetryUsesChromeClockDomain(self): 19 def testTelemetryUsesChromeClockDomain(self):
22 20
23 tracing_controller = self._browser.platform.tracing_controller 21 tracing_controller = self._browser.platform.tracing_controller
24 options = tracing_config.TracingConfig() 22 options = tracing_config.TracingConfig()
25 options.enable_chrome_trace = True 23 options.enable_chrome_trace = True
26 tracing_controller.StartTracing(options) 24 tracing_controller.StartTracing(options)
27 25
28 full_trace = tracing_controller.StopTracing() 26 full_trace = tracing_controller.StopTracing()
29 chrome_sync = GetSyncEvents( 27 chrome_sync = GetSyncEvents(
30 full_trace.GetTraceFor(trace_data.CHROME_TRACE_PART)['traceEvents']) 28 full_trace.GetTraceFor(trace_data.CHROME_TRACE_PART)['traceEvents'])
31 telemetry_sync = GetSyncEvents( 29 telemetry_sync = GetSyncEvents(
32 full_trace.GetTraceFor(trace_data.TELEMETRY_PART)['traceEvents']) 30 full_trace.GetTraceFor(trace_data.TELEMETRY_PART)['traceEvents'])
33 31
34 assert len(chrome_sync) == 1 32 assert len(chrome_sync) == 1
35 assert len(telemetry_sync) == 1 33 assert len(telemetry_sync) == 1
36 34
37 # If Telemetry and Chrome are in the same clock domain, the Chrome sync 35 # If Telemetry and Chrome are in the same clock domain, the Chrome sync
38 # timestamp should be between Telemetry's sync start and end timestamps. 36 # timestamp should be between Telemetry's sync start and end timestamps.
39 ts_telemetry_start = telemetry_sync[0]['args']['issue_ts'] 37 ts_telemetry_start = telemetry_sync[0]['args']['issue_ts']
40 ts_chrome = chrome_sync[0]['ts'] 38 ts_chrome = chrome_sync[0]['ts']
41 ts_telemetry_end = telemetry_sync[0]['ts'] 39 ts_telemetry_end = telemetry_sync[0]['ts']
42 assert ts_chrome > ts_telemetry_start 40 assert ts_chrome > ts_telemetry_start
43 assert ts_telemetry_end > ts_chrome 41 assert ts_telemetry_end > ts_chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698