Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 the test with xvfb on linux. Runs the test normally on other platforms. | 6 """Runs the test with xvfb on linux. Runs the test normally on other platforms. |
| 7 | 7 |
| 8 For simplicity in gyp targets, this script just runs the test normal on | 8 For simplicity in gyp targets, this script just runs the test normal on |
| 9 non-linux platforms. | 9 non-linux platforms. |
| 10 """ | 10 """ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 return 3 | 106 return 3 |
| 107 # Inhibit recursion. | 107 # Inhibit recursion. |
| 108 env['_CHROMIUM_INSIDE_XVFB'] = '1' | 108 env['_CHROMIUM_INSIDE_XVFB'] = '1' |
| 109 # Some ChromeOS tests need a window manager. Technically, it could be | 109 # Some ChromeOS tests need a window manager. Technically, it could be |
| 110 # another script but that would be overkill. | 110 # another script but that would be overkill. |
| 111 try: | 111 try: |
| 112 ice_cmd = ['icewm'] | 112 ice_cmd = ['icewm'] |
| 113 subprocess.Popen( | 113 subprocess.Popen( |
| 114 ice_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) | 114 ice_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) |
| 115 except OSError: | 115 except OSError: |
| 116 print >> sys.stderr, 'Failed to run %s' % ' '.join(cmd) | 116 print >> sys.stderr, 'Failed to run %s' % ' '.join(ice_cmd) |
|
M-A Ruel
2012/08/30 19:43:17
Argh. Thanks!
csharp
2012/08/30 20:17:48
No problem, I think I was the one who introduced t
| |
| 117 return 1 | 117 return 1 |
| 118 return test_env.run_executable(cmd, env) | 118 return test_env.run_executable(cmd, env) |
| 119 finally: | 119 finally: |
| 120 if pid: | 120 if pid: |
| 121 kill(pid) | 121 kill(pid) |
| 122 | 122 |
| 123 | 123 |
| 124 def main(): | 124 def main(): |
| 125 if len(sys.argv) < 3: | 125 if len(sys.argv) < 3: |
| 126 print >> sys.stderr, ( | 126 print >> sys.stderr, ( |
| 127 'Usage: xvfb.py [path to build_dir] [command args...]') | 127 'Usage: xvfb.py [path to build_dir] [command args...]') |
| 128 return 2 | 128 return 2 |
| 129 return run_executable(sys.argv[2:], sys.argv[1], os.environ.copy()) | 129 return run_executable(sys.argv[2:], sys.argv[1], os.environ.copy()) |
| 130 | 130 |
| 131 | 131 |
| 132 if __name__ == "__main__": | 132 if __name__ == "__main__": |
| 133 sys.exit(main()) | 133 sys.exit(main()) |
| OLD | NEW |