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

Unified Diff: systrace/systrace/tracing_agents/atrace_agent_unittest.py

Issue 2276263003: Pass in custom options to Systrace agents (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: systrace/systrace/tracing_agents/atrace_agent_unittest.py
diff --git a/systrace/systrace/tracing_agents/atrace_agent_unittest.py b/systrace/systrace/tracing_agents/atrace_agent_unittest.py
index 73b3251dada247bf9f557e9b9bf691543f5571d8..8bf658529982fb2c4191e45ffc2c5c1aad194106 100755
--- a/systrace/systrace/tracing_agents/atrace_agent_unittest.py
+++ b/systrace/systrace/tracing_agents/atrace_agent_unittest.py
@@ -54,6 +54,7 @@ class AtraceAgentTest(unittest.TestCase):
@decorators.HostOnlyTest
def test_construct_atrace_args(self):
options, categories = run_systrace.parse_options(SYSTRACE_CMD)
+ options.atrace_categories = categories
tracer_args = atrace_agent._construct_atrace_args(options, categories)
self.assertEqual(' '.join(TRACE_ARGS), ' '.join(tracer_args))
@@ -65,8 +66,8 @@ class AtraceAgentTest(unittest.TestCase):
atrace_data_raw = f2.read()
options, categories = run_systrace.parse_options(STOP_FIX_UPS)
agent = atrace_agent.AtraceAgent()
- agent._options = options
- agent._categories = categories
+ agent._config = options
+ agent._config.atrace_categories = categories
trace_data = agent._preprocess_trace_data(atrace_data_raw)
self.assertEqual(atrace_data, trace_data)
@@ -141,6 +142,7 @@ class BootAgentTest(unittest.TestCase):
tracer_args = atrace_agent._construct_boot_trace_command(options)
self.assertEqual(' '.join(TRACE_BOOT_CMD), ' '.join(tracer_args))
+
if __name__ == "__main__":
logging.getLogger().setLevel(logging.DEBUG)
unittest.main(verbosity=2)
« no previous file with comments | « systrace/systrace/tracing_agents/atrace_agent.py ('k') | systrace/systrace/tracing_agents/atrace_from_file_agent.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698