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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 def start_xvfb(xvfb_path, display): | 43 def start_xvfb(xvfb_path, display): |
44 """Starts a virtual X server that we run the tests in. | 44 """Starts a virtual X server that we run the tests in. |
45 | 45 |
46 This makes it so we can run the tests even if we didn't start the tests from | 46 This makes it so we can run the tests even if we didn't start the tests from |
47 an X session. | 47 an X session. |
48 | 48 |
49 Args: | 49 Args: |
50 xvfb_path: Path to Xvfb. | 50 xvfb_path: Path to Xvfb. |
51 """ | 51 """ |
52 cmd = [xvfb_path, display, '-screen', '0', '1024x768x24', '-ac', | 52 cmd = [xvfb_path, display, '-screen', '0', '1024x768x24', '-ac', |
53 '-nolisten', 'tcp'] | 53 '-nolisten', 'tcp', '-dpi', '96'] |
54 try: | 54 try: |
55 proc = subprocess.Popen( | 55 proc = subprocess.Popen( |
56 cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 56 cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
57 except OSError: | 57 except OSError: |
58 print >> sys.stderr, 'Failed to run %s' % ' '.join(cmd) | 58 print >> sys.stderr, 'Failed to run %s' % ' '.join(cmd) |
59 return | 59 return |
60 return proc | 60 return proc |
61 | 61 |
62 | 62 |
63 def wait_for_xvfb(xdisplaycheck, env): | 63 def wait_for_xvfb(xdisplaycheck, env): |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 def main(): | 137 def main(): |
138 if len(sys.argv) < 3: | 138 if len(sys.argv) < 3: |
139 print >> sys.stderr, ( | 139 print >> sys.stderr, ( |
140 'Usage: xvfb.py [path to build_dir] [command args...]') | 140 'Usage: xvfb.py [path to build_dir] [command args...]') |
141 return 2 | 141 return 2 |
142 return run_executable(sys.argv[2:], sys.argv[1], os.environ.copy()) | 142 return run_executable(sys.argv[2:], sys.argv[1], os.environ.copy()) |
143 | 143 |
144 | 144 |
145 if __name__ == "__main__": | 145 if __name__ == "__main__": |
146 sys.exit(main()) | 146 sys.exit(main()) |
OLD | NEW |