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

Side by Side Diff: systrace/profile_chrome/chrome_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 import json 5 import json
6 6
7 from profile_chrome import chrome_tracing_agent 7 from profile_chrome import chrome_tracing_agent
8 from profile_chrome import agents_unittest 8 from profile_chrome import agents_unittest
9 9
10 10
11 class ChromeAgentTest(agents_unittest.BaseAgentTest): 11 class ChromeAgentTest(agents_unittest.BaseAgentTest):
12 def testGetCategories(self): 12 def testGetCategories(self):
13 categories = \ 13 categories = \
14 chrome_tracing_agent.ChromeTracingAgent.GetCategories( 14 chrome_tracing_agent.ChromeTracingAgent.GetCategories(
15 self.device, self.package_info) 15 self.device, self.package_info)
16 16
17 self.assertEquals(len(categories), 2) 17 self.assertEquals(len(categories), 2)
18 self.assertTrue(categories[0]) 18 self.assertTrue(categories[0])
19 self.assertTrue(categories[1]) 19 self.assertTrue(categories[1])
20 20
21 def testTracing(self): 21 def testTracing(self):
22 categories = '*' 22 categories = '*'
23 ring_buffer = False 23 ring_buffer = False
24 agent = chrome_tracing_agent.ChromeTracingAgent(self.device, 24 agent = chrome_tracing_agent.ChromeTracingAgent(self.device,
25 self.package_info, 25 self.package_info,
26 categories,
27 ring_buffer) 26 ring_buffer)
28 27
29 agent.StartAgentTracing(None, None) 28 agent.StartAgentTracing(chrome_tracing_agent.ChromeConfig(categories, None,
29 None, None, None,
30 None, None,
31 None))
30 agent.StopAgentTracing() 32 agent.StopAgentTracing()
31 result = agent.GetResults() 33 result = agent.GetResults()
32 json.loads(result.raw_data) 34 json.loads(result.raw_data)
OLDNEW
« no previous file with comments | « systrace/profile_chrome/chrome_tracing_agent.py ('k') | systrace/profile_chrome/ddms_tracing_agent.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698