OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/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 import glob | 6 import glob |
7 import optparse | 7 import optparse |
8 import os.path | 8 import os.path |
9 import socket | 9 import socket |
10 import sys | 10 import sys |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 # Tests, such as run_inbrowser_trusted_crash_in_startup_test, may not use the | 200 # Tests, such as run_inbrowser_trusted_crash_in_startup_test, may not use the |
201 # RunFromCommand line entry point - and otherwise get stuck in an infinite | 201 # RunFromCommand line entry point - and otherwise get stuck in an infinite |
202 # loop when something goes wrong and the hard timeout is not set. | 202 # loop when something goes wrong and the hard timeout is not set. |
203 # http://code.google.com/p/chromium/issues/detail?id=105406 | 203 # http://code.google.com/p/chromium/issues/detail?id=105406 |
204 if options.hard_timeout is None: | 204 if options.hard_timeout is None: |
205 options.hard_timeout = options.timeout * 4 | 205 options.hard_timeout = options.timeout * 4 |
206 | 206 |
207 options.files.append(os.path.join(script_dir, 'browserdata', 'nacltest.js')) | 207 options.files.append(os.path.join(script_dir, 'browserdata', 'nacltest.js')) |
208 | 208 |
209 # Setup the environment with the setuid sandbox path. | 209 # Setup the environment with the setuid sandbox path. |
210 os.environ.update(test_env.get_sandbox_env(sys.argv, os.environ)) | 210 os.environ.update(test_env.get_sandbox_env(os.environ)) |
211 | 211 |
212 # Create server | 212 # Create server |
213 host = GetHostName() | 213 host = GetHostName() |
214 try: | 214 try: |
215 server = browsertester.server.Create(host, options.port) | 215 server = browsertester.server.Create(host, options.port) |
216 except Exception: | 216 except Exception: |
217 sys.stdout.write('Could not bind %r, falling back to localhost.\n' % host) | 217 sys.stdout.write('Could not bind %r, falling back to localhost.\n' % host) |
218 server = browsertester.server.Create('localhost', options.port) | 218 server = browsertester.server.Create('localhost', options.port) |
219 | 219 |
220 # If port 0 has been requested, an arbitrary port will be bound so we need to | 220 # If port 0 has been requested, an arbitrary port will be bound so we need to |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 # Validate the URL | 391 # Validate the URL |
392 url = options.url | 392 url = options.url |
393 if url is None: | 393 if url is None: |
394 parser.error('Must specify a URL') | 394 parser.error('Must specify a URL') |
395 | 395 |
396 return Run(url, options) | 396 return Run(url, options) |
397 | 397 |
398 | 398 |
399 if __name__ == '__main__': | 399 if __name__ == '__main__': |
400 sys.exit(RunFromCommandLine()) | 400 sys.exit(RunFromCommandLine()) |
OLD | NEW |