1 # Copyright 2011 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.
11 from .trace_test import *
15 class LogMultipleProcessIOTest(TraceTest):
23 # Test that starting a subprocess to record into an existing tracefile works.
24 def test_one_subprocess(self):
27 proc = subprocess.Popen([sys.executable, "-m", __name__, self.trace_filename, "_test_one_subprocess_child"])
31 parent_events = res.findByName('parent')
32 child_events = res.findByName('child')
33 self.assertEquals(2, len(parent_events))
34 self.assertEquals(2, len(child_events))
36 def _test_one_subprocess_child(self):
41 if __name__ == "__main__":
42 if len(sys.argv) != 3:
43 raise Exception("Expected: method name")
44 trace_enable(sys.argv[1])
45 t = LogMultipleProcessIOTest(sys.argv[2])