| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 from os.path import dirname, abspath | 10 from os.path import dirname, abspath |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 if platform.system() == 'Windows': | 405 if platform.system() == 'Windows': |
| 406 browsers += ['ie'] | 406 browsers += ['ie'] |
| 407 has_shell = True | 407 has_shell = True |
| 408 if 'dartium' in browsers: | 408 if 'dartium' in browsers: |
| 409 # Fetch it if necessary. | 409 # Fetch it if necessary. |
| 410 get_dartium = ['python', | 410 get_dartium = ['python', |
| 411 os.path.join(DART_INSTALL_LOCATION, 'tools', 'get_drt.py'), | 411 os.path.join(DART_INSTALL_LOCATION, 'tools', 'get_drt.py'), |
| 412 '--dartium'] | 412 '--dartium'] |
| 413 # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. | 413 # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. |
| 414 # Perhaps there is a better place to put that or this. | 414 # Perhaps there is a better place to put that or this. |
| 415 subprocess.Popen(get_dartium, shell=has_shell) | 415 subprocess.call(get_dartium, stdout=sys.stdout, stderr=sys.stderr, |
| 416 shell=has_shell) |
| 416 return browsers | 417 return browsers |
| 417 | 418 |
| 418 | 419 |
| 419 class CommonBrowserTest(RuntimePerformanceTest): | 420 class CommonBrowserTest(RuntimePerformanceTest): |
| 420 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the | 421 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the |
| 421 browser.""" | 422 browser.""" |
| 422 | 423 |
| 423 def __init__(self, test_runner): | 424 def __init__(self, test_runner): |
| 424 """Args: | 425 """Args: |
| 425 test_runner: Reference to the object that notifies us when to run.""" | 426 test_runner: Reference to the object that notifies us when to run.""" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 browser, version_name) | 628 browser, version_name) |
| 628 self.test.trace_file = os.path.join( | 629 self.test.trace_file = os.path.join( |
| 629 'tools', 'testing', 'perf_testing', self.test.result_folder_name, | 630 'tools', 'testing', 'perf_testing', self.test.result_folder_name, |
| 630 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) | 631 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) |
| 631 self.add_svn_revision_to_trace(self.test.trace_file, browser) | 632 self.add_svn_revision_to_trace(self.test.trace_file, browser) |
| 632 file_path = '"%s"' % os.path.join(os.getcwd(), dromaeo_path, | 633 file_path = '"%s"' % os.path.join(os.getcwd(), dromaeo_path, |
| 633 'index-js.html?%s' % version) | 634 'index-js.html?%s' % version) |
| 634 self.test.test_runner.run_cmd( | 635 self.test.test_runner.run_cmd( |
| 635 ['python', os.path.join('tools', 'testing', 'run_selenium.py'), | 636 ['python', os.path.join('tools', 'testing', 'run_selenium.py'), |
| 636 '--out', file_path, '--browser', browser, | 637 '--out', file_path, '--browser', browser, |
| 637 '--timeout', '600', '--mode', 'dromaeo'], self.test.trace_file, | 638 '--timeout', '900', '--mode', 'dromaeo'], self.test.trace_file, |
| 638 append=True) | 639 append=True) |
| 639 | 640 |
| 640 @staticmethod | 641 @staticmethod |
| 641 def get_dromaeo_url_query(browser, version): | 642 def get_dromaeo_url_query(browser, version): |
| 642 if browser == 'dartium': | 643 if browser == 'dartium': |
| 643 version = version.replace('frog', 'dart') | 644 version = version.replace('frog', 'dart') |
| 644 version = version.replace('_','&') | 645 version = version.replace('_','&') |
| 645 tags = DromaeoTester.get_valid_dromaeo_tags() | 646 tags = DromaeoTester.get_valid_dromaeo_tags() |
| 646 return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) | 647 return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) |
| 647 | 648 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 while True: | 932 while True: |
| 932 if runner.has_new_code(): | 933 if runner.has_new_code(): |
| 933 runner.run_test_sequence() | 934 runner.run_test_sequence() |
| 934 else: | 935 else: |
| 935 time.sleep(200) | 936 time.sleep(200) |
| 936 else: | 937 else: |
| 937 runner.run_test_sequence() | 938 runner.run_test_sequence() |
| 938 | 939 |
| 939 if __name__ == '__main__': | 940 if __name__ == '__main__': |
| 940 main() | 941 main() |
| OLD | NEW |