OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Runs an isolate bundled Telemetry GPU integration test. | 6 """Runs an isolate bundled Telemetry GPU integration test. |
7 | 7 |
8 This script attempts to emulate the contract of gtest-style tests | 8 This script attempts to emulate the contract of gtest-style tests |
9 invoked via recipes. The main contract is that the caller passes the | 9 invoked via recipes. The main contract is that the caller passes the |
10 argument: | 10 argument: |
(...skipping 28 matching lines...) Expand all Loading... | |
39 CHROME_SANDBOX_ENV = 'CHROME_DEVEL_SANDBOX' | 39 CHROME_SANDBOX_ENV = 'CHROME_DEVEL_SANDBOX' |
40 CHROME_SANDBOX_PATH = '/opt/chromium/chrome_sandbox' | 40 CHROME_SANDBOX_PATH = '/opt/chromium/chrome_sandbox' |
41 | 41 |
42 def main(): | 42 def main(): |
43 parser = argparse.ArgumentParser() | 43 parser = argparse.ArgumentParser() |
44 parser.add_argument( | 44 parser.add_argument( |
45 '--isolated-script-test-output', type=str, | 45 '--isolated-script-test-output', type=str, |
46 required=True) | 46 required=True) |
47 parser.add_argument('--xvfb', help='Start xvfb.', action='store_true') | 47 parser.add_argument('--xvfb', help='Start xvfb.', action='store_true') |
48 args, rest_args = parser.parse_known_args() | 48 args, rest_args = parser.parse_known_args() |
49 # Remove the chartjson extra arg until this script cares about chartjson | |
50 # results from telemetry | |
51 index = 0 | |
52 for arg in rest_args: | |
53 if '--isolated-script-test-chartjson-output' in arg: | |
54 rest_args.pop(index) | |
55 break | |
56 index += 1 | |
Ken Russell (switch to Gerrit)
2016/09/19 20:27:57
It's not necessary to manually extract it -- addin
eyaich1
2016/09/20 12:52:02
Done.
| |
57 | |
49 xvfb_proc = None | 58 xvfb_proc = None |
50 openbox_proc = None | 59 openbox_proc = None |
51 xcompmgr_proc = None | 60 xcompmgr_proc = None |
52 env = os.environ.copy() | 61 env = os.environ.copy() |
53 # Assume we want to set up the sandbox environment variables all the | 62 # Assume we want to set up the sandbox environment variables all the |
54 # time; doing so is harmless on non-Linux platforms and is needed | 63 # time; doing so is harmless on non-Linux platforms and is needed |
55 # all the time on Linux. | 64 # all the time on Linux. |
56 env[CHROME_SANDBOX_ENV] = CHROME_SANDBOX_PATH | 65 env[CHROME_SANDBOX_ENV] = CHROME_SANDBOX_PATH |
57 if args.xvfb and xvfb.should_start_xvfb(env): | 66 if args.xvfb and xvfb.should_start_xvfb(env): |
58 xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env, | 67 xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 117 |
109 if __name__ == '__main__': | 118 if __name__ == '__main__': |
110 # Conform minimally to the protocol defined by ScriptTest. | 119 # Conform minimally to the protocol defined by ScriptTest. |
111 if 'compile_targets' in sys.argv: | 120 if 'compile_targets' in sys.argv: |
112 funcs = { | 121 funcs = { |
113 'run': None, | 122 'run': None, |
114 'compile_targets': main_compile_targets, | 123 'compile_targets': main_compile_targets, |
115 } | 124 } |
116 sys.exit(common.run_script(sys.argv[1:], funcs)) | 125 sys.exit(common.run_script(sys.argv[1:], funcs)) |
117 sys.exit(main()) | 126 sys.exit(main()) |
OLD | NEW |