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

Side by Side Diff: systrace/profile_chrome/atrace_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
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 profile_chrome import agents_unittest 5 from profile_chrome import agents_unittest
6 from profile_chrome import atrace_tracing_agent 6 from profile_chrome import atrace_tracing_agent
7 7
8 8
9 class AtraceAgentTest(agents_unittest.BaseAgentTest): 9 class AtraceAgentTest(agents_unittest.BaseAgentTest):
10 def testGetCategories(self): 10 def testGetCategories(self):
11 categories = \ 11 categories = \
12 atrace_tracing_agent.AtraceAgent.GetCategories(self.device) 12 atrace_tracing_agent.AtraceAgent.GetCategories(self.device)
13 self.assertTrue(categories) 13 self.assertTrue(categories)
14 assert 'gfx' in ' '.join(categories) 14 assert 'gfx' in ' '.join(categories)
15 15
16 def testTracing(self): 16 def testTracing(self):
17 categories = ['gfx', 'input', 'view'] 17 categories = 'gfx,input,view'
18 ring_buffer = False 18 ring_buffer = False
19 agent = atrace_tracing_agent.AtraceAgent(self.device, 19 agent = atrace_tracing_agent.AtraceAgent(self.device,
20 categories,
21 ring_buffer) 20 ring_buffer)
22 21
23 try: 22 try:
24 agent.StartAgentTracing(None, None) 23 agent.StartAgentTracing(atrace_tracing_agent.AtraceConfig(categories))
25 finally: 24 finally:
26 agent.StopAgentTracing() 25 agent.StopAgentTracing()
27 result = agent.GetResults() 26 result = agent.GetResults()
28 27
29 self.assertFalse(agent.IsTracingOn()) 28 self.assertFalse(agent.IsTracingOn())
30 self.assertTrue('CPU#' in result.raw_data) 29 self.assertTrue('CPU#' in result.raw_data)
OLDNEW
« no previous file with comments | « systrace/profile_chrome/atrace_tracing_agent.py ('k') | systrace/profile_chrome/chrome_startup_tracing_agent.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698