• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5import json
6
7from profile_chrome import chrome_tracing_agent
8from systrace import decorators
9from systrace.tracing_agents import agents_unittest
10
11
12class ChromeAgentTest(agents_unittest.BaseAgentTest):
13  # TODO(washingtonp): This test seems to fail on the version of Android
14  # currently on the Trybot servers (KTU84P), although it works on Android M.
15  # Either upgrade the version of Android on the Trybot servers or determine
16  # if there is a way to run this agent on Android KTU84P.
17  @decorators.Disabled
18  def testGetCategories(self):
19    curr_browser = self.GetChromeProcessID()
20    if curr_browser is None:
21      self.StartBrowser()
22
23    categories = \
24        chrome_tracing_agent.ChromeTracingAgent.GetCategories(
25            self.device, self.package_info)
26
27    self.assertEquals(len(categories), 2)
28    self.assertTrue(categories[0])
29    self.assertTrue(categories[1])
30
31  # TODO(washingtonp): This test is pretty flaky on the version of Android
32  # currently on the Trybot servers (KTU84P), although it works on Android M.
33  # Either upgrade the version of Android on the Trybot servers or determine
34  # if there is a way to run this agent on Android KTU84P.
35  @decorators.Disabled
36  def testTracing(self):
37    curr_browser = self.GetChromeProcessID()
38    if curr_browser is None:
39      self.StartBrowser()
40
41    categories = '*'
42    ring_buffer = False
43    agent = chrome_tracing_agent.ChromeTracingAgent(self.device,
44                                                    self.package_info,
45                                                    ring_buffer)
46    agent.StartAgentTracing(chrome_tracing_agent.ChromeConfig(categories, None,
47        None, None, None, None, None, None, ring_buffer, self.device,
48        self.package_info))
49    agent.StopAgentTracing()
50    result = agent.GetResults()
51    json.loads(result.raw_data)
52