Make run-benchmark script supports 'config' key in test plan.
[WebKit-https.git] / Tools / Scripts / webkitpy / benchmark_runner / benchmark_runner.py
index 237389c24dc139f6c606d1edbb2cf72c5c59621b..7ad2fbb53a17150318a1b9b3aa04a45db128171c 100644 (file)
@@ -42,7 +42,9 @@ class BenchmarkRunner(object):
                 self._build_dir = os.path.abspath(build_dir) if build_dir else None
                 self._output_file = output_file
                 self._scale_unit = scale_unit
-                self._device_id = device_id
+                self._config = self._plan.get('config', {})
+                if device_id:
+                    self._config['device_id'] = device_id
         except IOError as error:
             _log.error('Can not open plan file: {plan_file} - Error {error}'.format(plan_file=plan_file, error=error))
             raise error
@@ -86,7 +88,7 @@ class BenchmarkRunner(object):
         for iteration in xrange(1, count + 1):
             _log.info('Start the iteration {current_iteration} of {iterations} for current benchmark'.format(current_iteration=iteration, iterations=count))
             try:
-                self._browser_driver.prepare_env(self._device_id)
+                self._browser_driver.prepare_env(self._config)
 
                 if 'entry_point' in self._plan:
                     result = self._run_one_test(web_root, self._plan['entry_point'])