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

Side by Side Diff: systrace/profile_chrome/perf_tracing_agent_unittest.py

Issue 2276263003: Pass in custom options to Systrace agents (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Rebase Created 4 years, 3 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 | « systrace/profile_chrome/perf_tracing_agent.py ('k') | systrace/profile_chrome/profiler.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 import json 5 import json
6 6
7 from profile_chrome import agents_unittest 7 from profile_chrome import agents_unittest
8 from profile_chrome import perf_tracing_agent 8 from profile_chrome import perf_tracing_agent
9 from profile_chrome import ui 9 from profile_chrome import ui
10 10
11 11
12 class PerfProfilerAgentTest(agents_unittest.BaseAgentTest): 12 class PerfProfilerAgentTest(agents_unittest.BaseAgentTest):
13 def testGetCategories(self): 13 def testGetCategories(self):
14 if not perf_tracing_agent.PerfProfilerAgent.IsSupported(): 14 if not perf_tracing_agent.PerfProfilerAgent.IsSupported():
15 return 15 return
16 categories = \ 16 categories = \
17 perf_tracing_agent.PerfProfilerAgent.GetCategories(self.device) 17 perf_tracing_agent.PerfProfilerAgent.GetCategories(self.device)
18 assert 'cycles' in ' '.join(categories) 18 assert 'cycles' in ' '.join(categories)
19 19
20 def testTracing(self): 20 def testTracing(self):
21 if not perf_tracing_agent.PerfProfilerAgent.IsSupported(): 21 if not perf_tracing_agent.PerfProfilerAgent.IsSupported():
22 return 22 return
23 ui.EnableTestMode() 23 ui.EnableTestMode()
24 categories = ['cycles'] 24 categories = 'cycles'
25 agent = perf_tracing_agent.PerfProfilerAgent(self.device, 25 agent = perf_tracing_agent.PerfProfilerAgent(self.device)
26 categories)
27 26
28 try: 27 try:
29 agent.StartAgentTracing(None, None) 28 agent.StartAgentTracing(perf_tracing_agent.PerfConfig(categories))
30 finally: 29 finally:
31 agent.StopAgentTracing() 30 agent.StopAgentTracing()
32 31
33 result = agent.GetResults() 32 result = agent.GetResults()
34 json.loads(result.raw_data) 33 json.loads(result.raw_data)
OLDNEW
« no previous file with comments | « systrace/profile_chrome/perf_tracing_agent.py ('k') | systrace/profile_chrome/profiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698