| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 if platform.system() == 'Windows': | 394 if platform.system() == 'Windows': |
| 395 browsers += ['ie'] | 395 browsers += ['ie'] |
| 396 has_shell = True | 396 has_shell = True |
| 397 if 'dartium' in browsers: | 397 if 'dartium' in browsers: |
| 398 # Fetch it if necessary. | 398 # Fetch it if necessary. |
| 399 get_dartium = ['python', | 399 get_dartium = ['python', |
| 400 os.path.join(DART_INSTALL_LOCATION, 'tools', 'get_drt.py'), | 400 os.path.join(DART_INSTALL_LOCATION, 'tools', 'get_drt.py'), |
| 401 '--dartium'] | 401 '--dartium'] |
| 402 # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. | 402 # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. |
| 403 # Perhaps there is a better place to put that or this. | 403 # Perhaps there is a better place to put that or this. |
| 404 subprocess.Popen(get_dartium, shell=has_shell) | 404 subprocess.call(get_dartium, stdout=sys.stdout, stderr=sys.stderr, |
| 405 shell=has_shell) |
| 405 return browsers | 406 return browsers |
| 406 | 407 |
| 407 | 408 |
| 408 class CommonBrowserTest(RuntimePerformanceTest): | 409 class CommonBrowserTest(RuntimePerformanceTest): |
| 409 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the | 410 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the |
| 410 browser.""" | 411 browser.""" |
| 411 | 412 |
| 412 def __init__(self, test_runner): | 413 def __init__(self, test_runner): |
| 413 """Args: | 414 """Args: |
| 414 test_runner: Reference to the object that notifies us when to run.""" | 415 test_runner: Reference to the object that notifies us when to run.""" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 browser, version_name) | 611 browser, version_name) |
| 611 self.test.trace_file = os.path.join( | 612 self.test.trace_file = os.path.join( |
| 612 'tools', 'testing', 'perf_testing', self.test.result_folder_name, | 613 'tools', 'testing', 'perf_testing', self.test.result_folder_name, |
| 613 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) | 614 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) |
| 614 self.add_svn_revision_to_trace(self.test.trace_file, browser) | 615 self.add_svn_revision_to_trace(self.test.trace_file, browser) |
| 615 file_path = '"%s"' % os.path.join(os.getcwd(), dromaeo_path, | 616 file_path = '"%s"' % os.path.join(os.getcwd(), dromaeo_path, |
| 616 'index-js.html?%s' % version) | 617 'index-js.html?%s' % version) |
| 617 self.test.test_runner.run_cmd( | 618 self.test.test_runner.run_cmd( |
| 618 ['python', os.path.join('tools', 'testing', 'run_selenium.py'), | 619 ['python', os.path.join('tools', 'testing', 'run_selenium.py'), |
| 619 '--out', file_path, '--browser', browser, | 620 '--out', file_path, '--browser', browser, |
| 620 '--timeout', '600', '--mode', 'dromaeo'], self.test.trace_file, | 621 '--timeout', '900', '--mode', 'dromaeo'], self.test.trace_file, |
| 621 append=True) | 622 append=True) |
| 622 | 623 |
| 623 @staticmethod | 624 @staticmethod |
| 624 def get_dromaeo_url_query(browser, version): | 625 def get_dromaeo_url_query(browser, version): |
| 625 if browser == 'dartium': | 626 if browser == 'dartium': |
| 626 version = version.replace('frog', 'dart') | 627 version = version.replace('frog', 'dart') |
| 627 version = version.replace('_','&') | 628 version = version.replace('_','&') |
| 628 tags = DromaeoTester.get_valid_dromaeo_tags() | 629 tags = DromaeoTester.get_valid_dromaeo_tags() |
| 629 return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) | 630 return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) |
| 630 | 631 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 while True: | 922 while True: |
| 922 if runner.has_new_code(): | 923 if runner.has_new_code(): |
| 923 runner.run_test_sequence() | 924 runner.run_test_sequence() |
| 924 else: | 925 else: |
| 925 time.sleep(200) | 926 time.sleep(200) |
| 926 else: | 927 else: |
| 927 runner.run_test_sequence() | 928 runner.run_test_sequence() |
| 928 | 929 |
| 929 if __name__ == '__main__': | 930 if __name__ == '__main__': |
| 930 main() | 931 main() |
| OLD | NEW |