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

Side by Side Diff: tools/profile_chrome/systrace_controller_unittest.py

Issue 402803005: Move adb_profile_chrome to profile_chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « tools/profile_chrome/systrace_controller.py ('k') | tools/profile_chrome/trace_packager.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 os 5 import os
6 6
7 from adb_profile_chrome import controllers_unittest 7 from profile_chrome import controllers_unittest
8 from adb_profile_chrome import systrace_controller 8 from profile_chrome import systrace_controller
9 9
10 10
11 class SystraceControllerTest(controllers_unittest.BaseControllerTest): 11 class SystraceControllerTest(controllers_unittest.BaseControllerTest):
12 def testGetCategories(self): 12 def testGetCategories(self):
13 categories = \ 13 categories = \
14 systrace_controller.SystraceController.GetCategories(self.device) 14 systrace_controller.SystraceController.GetCategories(self.device)
15 self.assertTrue(categories) 15 self.assertTrue(categories)
16 assert 'gfx' in ' '.join(categories) 16 assert 'gfx' in ' '.join(categories)
17 17
18 def testTracing(self): 18 def testTracing(self):
19 categories = ['gfx', 'input', 'view'] 19 categories = ['gfx', 'input', 'view']
20 ring_buffer = False 20 ring_buffer = False
21 controller = systrace_controller.SystraceController(self.device, 21 controller = systrace_controller.SystraceController(self.device,
22 categories, 22 categories,
23 ring_buffer) 23 ring_buffer)
24 24
25 interval = 1 25 interval = 1
26 try: 26 try:
27 controller.StartTracing(interval) 27 controller.StartTracing(interval)
28 finally: 28 finally:
29 controller.StopTracing() 29 controller.StopTracing()
30 30
31 result = controller.PullTrace() 31 result = controller.PullTrace()
32 try: 32 try:
33 with open(result) as f: 33 with open(result) as f:
34 self.assertTrue('CPU#' in f.read()) 34 self.assertTrue('CPU#' in f.read())
35 finally: 35 finally:
36 os.remove(result) 36 os.remove(result)
OLDNEW
« no previous file with comments | « tools/profile_chrome/systrace_controller.py ('k') | tools/profile_chrome/trace_packager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698