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

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

Issue 1738563002: Remove //tools/profile_chrome from Chromium repo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « tools/profile_chrome/perf_controller.py ('k') | tools/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
(Empty)
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
3 # found in the LICENSE file.
4
5 import os
6 import json
7
8 from profile_chrome import controllers_unittest
9 from profile_chrome import perf_controller
10 from profile_chrome import ui
11
12
13 class PerfProfilerControllerTest(controllers_unittest.BaseControllerTest):
14 def testGetCategories(self):
15 if not perf_controller.PerfProfilerController.IsSupported():
16 return
17 categories = \
18 perf_controller.PerfProfilerController.GetCategories(self.device)
19 assert 'cycles' in ' '.join(categories)
20
21 def testTracing(self):
22 if not perf_controller.PerfProfilerController.IsSupported():
23 return
24 ui.EnableTestMode()
25 categories = ['cycles']
26 controller = perf_controller.PerfProfilerController(self.device,
27 categories)
28
29 interval = 1
30 try:
31 controller.StartTracing(interval)
32 finally:
33 controller.StopTracing()
34
35 result = controller.PullTrace()
36 try:
37 with open(result) as f:
38 json.loads(f.read())
39 finally:
40 os.remove(result)
OLDNEW
« no previous file with comments | « tools/profile_chrome/perf_controller.py ('k') | tools/profile_chrome/profiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698