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

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

Issue 2297403003: Use Systrace tracing controller in profile_chrome (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Added property method for tracing controller's child agents 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 ring_buffer) 26 ring_buffer)
27 27
28 agent.StartAgentTracing(chrome_tracing_agent.ChromeConfig(categories, None, 28 agent.StartAgentTracing(chrome_tracing_agent.ChromeConfig(categories, None,
29 None, None, None, 29 None, None, None, None, None, None, ring_buffer, self.device,
30 None, None, 30 self.package_info))
31 None))
32 agent.StopAgentTracing() 31 agent.StopAgentTracing()
33 result = agent.GetResults() 32 result = agent.GetResults()
34 json.loads(result.raw_data) 33 json.loads(result.raw_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698