Chromium Code Reviews| Index: chrome/test/functional/media/media_test_runner.py |
| diff --git a/chrome/test/functional/media/media_test_runner.py b/chrome/test/functional/media/media_test_runner.py |
| index c605f9c2cf6dc33204a768037598f7c041356750..da9f95ff7f53490064290809f88e0e4b5da04c11 100755 |
| --- a/chrome/test/functional/media/media_test_runner.py |
| +++ b/chrome/test/functional/media/media_test_runner.py |
| @@ -112,6 +112,8 @@ def main(): |
| help=('Media file to be played using player.html. ' |
| 'The relative path needs to be specified starting ' |
| 'from data/html/ directory.')) |
| + parser.add_option('-a', '--reference_build', dest='reference_build', |
| + help='Include reference build run', default=False) |
|
dennis_jeffrey
2011/05/19 01:20:13
add the following parameter:
action='store_true'
imasaki1
2011/05/20 05:12:01
Done.
|
| options, args = parser.parse_args() |
| if args: |
| @@ -143,6 +145,12 @@ def main(): |
| all_data_list, options.input_matrix_testcase_name) |
| if media_info is not None: |
| test_data_list.append(media_info) |
| + |
| + # Determine if we need to loop. The defsault is False |
|
dennis_jeffrey
2011/05/19 01:20:13
I recommend this comment, if it's accurate:
# Det
Nirnimesh
2011/05/19 06:40:20
typo: defsault
imasaki1
2011/05/20 05:12:01
Done.
imasaki1
2011/05/20 05:12:01
Done.
|
| + reference_build_list = [False] |
| + # reference_build_list = [True] |
|
Nirnimesh
2011/05/19 06:40:20
remove commented code
imasaki1
2011/05/20 05:12:01
Done.
|
| + if options.reference_build: |
| + reference_build_list.append(True) |
|
dennis_jeffrey
2011/05/19 01:20:13
(optional) I recommend replacing lines 150-153 wit
imasaki1
2011/05/20 05:12:01
Done.
|
| # This is a loop for iterating through all videos defined above (list |
| # or matrix). Each video has associated tag and nickname for display |
| # purpose. |
| @@ -156,51 +164,54 @@ def main(): |
| # media cache). We are doing both here. Please note the length of |
| # CHROME_FLAGS and ADD_T_PARAMETERS should be the same. |
| for j in range(len(CHROME_FLAGS)): |
| - parent_envs = copy.deepcopy(os.environ) |
| - if options.input_matrix_filename is None: |
| - filename = os.path.join(os.pardir, filename) |
| - envs = { |
| - MediaTestEnvNames.MEDIA_TAG_ENV_NAME: tag, |
| - MediaTestEnvNames.MEDIA_FILENAME_ENV_NAME: filename, |
| - MediaTestEnvNames.MEDIA_FILENAME_NICKNAME_ENV_NAME: nickname, |
| - MediaTestEnvNames.PLAYER_HTML_URL_ENV_NAME: |
| - options.player_html_url, |
| - MediaTestEnvNames.PLAYER_HTML_URL_NICKNAME_ENV_NAME: |
| - options.player_html_url_nickname, |
| - MediaTestEnvNames.EXTRA_NICKNAME_ENV_NAME: |
| - EXTRA_NICKNAMES[j], |
| - # Enables or disables the media cache. |
| - # (refer to data/media/html/player.js) |
| - MediaTestEnvNames.ADD_T_PARAMETER_ENV_NAME: ADD_T_PARAMETERS[j], |
| - MediaTestEnvNames.PRINT_ONLY_TIME_ENV_NAME: PRINT_ONLY_TIME, |
| - MediaTestEnvNames.N_RUNS_ENV_NAME: str(options.number_of_runs), |
| - MediaTestEnvNames.REMOVE_FIRST_RESULT_ENV_NAME: |
| - REMOVE_FIRST_RESULT, |
| - MediaTestEnvNames.MEASURE_INTERVAL_ENV_NAME: |
| - str(options.measure_intervals), |
| - MediaTestEnvNames.TEST_SCENARIO_FILE_ENV_NAME: |
| - options.test_scenario_input_filename, |
| - MediaTestEnvNames.TEST_SCENARIO_ENV_NAME: |
| - options.test_scenario, |
| - } |
| - envs.update(parent_envs) |
| - if options.suite is None and options.test_prog_name is not None: |
| - # Suite is not used - run test program directly. |
| - test_prog_name = options.test_prog_name |
| - suite_string = '' |
| - else: |
| - # Suite is used. |
| - # The test script names are in the PYAUTO_TEST file. |
| - test_prog_name = pyauto_functional_script_name |
| - if options.suite is None: |
| - suite_name = DEFAULT_SUITE_NAME |
| + for reference_build in reference_build_list: |
| + parent_envs = copy.deepcopy(os.environ) |
| + if options.input_matrix_filename is None: |
| + par_filename = os.path.join(os.pardir, filename) |
| + envs = { |
| + MediaTestEnvNames.MEDIA_TAG_ENV_NAME: tag, |
| + MediaTestEnvNames.MEDIA_FILENAME_ENV_NAME: par_filename, |
| + MediaTestEnvNames.MEDIA_FILENAME_NICKNAME_ENV_NAME: nickname, |
| + MediaTestEnvNames.PLAYER_HTML_URL_ENV_NAME: |
| + options.player_html_url, |
| + MediaTestEnvNames.PLAYER_HTML_URL_NICKNAME_ENV_NAME: |
| + options.player_html_url_nickname, |
| + MediaTestEnvNames.EXTRA_NICKNAME_ENV_NAME: |
| + EXTRA_NICKNAMES[j], |
| + # Enables or disables the media cache. |
| + # (refer to data/media/html/player.js) |
| + MediaTestEnvNames.ADD_T_PARAMETER_ENV_NAME: ADD_T_PARAMETERS[j], |
| + MediaTestEnvNames.PRINT_ONLY_TIME_ENV_NAME: PRINT_ONLY_TIME, |
| + MediaTestEnvNames.N_RUNS_ENV_NAME: str(options.number_of_runs), |
| + MediaTestEnvNames.REMOVE_FIRST_RESULT_ENV_NAME: |
| + REMOVE_FIRST_RESULT, |
| + MediaTestEnvNames.MEASURE_INTERVAL_ENV_NAME: |
| + str(options.measure_intervals), |
| + MediaTestEnvNames.TEST_SCENARIO_FILE_ENV_NAME: |
| + options.test_scenario_input_filename, |
| + MediaTestEnvNames.TEST_SCENARIO_ENV_NAME: |
| + options.test_scenario, |
| + MediaTestEnvNames.REFERENCE_BUILD_ENV_NAME: |
| + str(reference_build), |
| + } |
| + envs.update(parent_envs) |
| + if options.suite is None and options.test_prog_name is not None: |
| + # Suite is not used - run test program directly. |
| + test_prog_name = options.test_prog_name |
| + suite_string = '' |
| else: |
| - suite_name = options.suite |
| - suite_string = ' --suite=%s' % suite_name |
| - test_prog_name = sys.executable + ' ' + test_prog_name |
| - cmd = test_prog_name + suite_string + ' ' + CHROME_FLAGS[j] |
| - proc = Popen(cmd, env=envs, shell=True) |
| - proc.communicate() |
| + # Suite is used. |
| + # The test script names are in the PYAUTO_TEST file. |
| + test_prog_name = pyauto_functional_script_name |
| + if options.suite is None: |
| + suite_name = DEFAULT_SUITE_NAME |
| + else: |
| + suite_name = options.suite |
| + suite_string = ' --suite=%s' % suite_name |
| + test_prog_name = sys.executable + ' ' + test_prog_name |
| + cmd = test_prog_name + suite_string + ' ' + CHROME_FLAGS[j] + ' -v' |
| + proc = Popen(cmd, env=envs, shell=True) |
| + proc.communicate() |
| if options.one_combination: |
| sys.exit(0) |