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

Side by Side Diff: build/android/chrome_profiler/chrome_controller_unittest.py

Issue 290013006: adb_profile_chrome: Refactor into multiple modules and add tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 6 years, 7 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
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 chrome_profiler import chrome_controller
9 from chrome_profiler import controllers_unittest
10
11
12 class ChromeControllerTest(controllers_unittest.BaseControllerTest):
13 def testGetCategories(self):
14 # Not supported on stable yet.
15 # TODO(skyostil): Remove this once category queries roll into stable.
16 if self.browser == 'stable':
17 return
18
19 categories = \
20 chrome_controller.ChromeTracingController.GetCategories(
21 self.device, self.package_info)
22
23 self.assertEquals(len(categories), 2)
24 self.assertTrue(categories[0])
25 self.assertTrue(categories[1])
26
27 def testTracing(self):
28 categories = '*'
29 ring_buffer = False
30 controller = chrome_controller.ChromeTracingController(self.device,
31 self.package_info,
32 categories,
33 ring_buffer)
34
35 interval = 1
36 try:
37 controller.StartTracing(interval)
38 finally:
39 controller.StopTracing()
40
41 result = controller.PullTrace()
42 try:
43 with open(result) as f:
44 json.loads(f.read())
45 finally:
46 os.remove(result)
OLDNEW
« no previous file with comments | « build/android/chrome_profiler/chrome_controller.py ('k') | build/android/chrome_profiler/controllers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698