Chromium Code Reviews| Index: tools/android/loading/sandwich_task_builder.py |
| diff --git a/tools/android/loading/sandwich_task_builder.py b/tools/android/loading/sandwich_task_builder.py |
| index 954c67ec221a8c300126f9931a4a670fbf96ee8d..b9ea41e181f3aa6d7eb05cf39ccd53b7e20aba97 100644 |
| --- a/tools/android/loading/sandwich_task_builder.py |
| +++ b/tools/android/loading/sandwich_task_builder.py |
| @@ -16,12 +16,15 @@ import sandwich_runner |
| import task_manager |
| -def NetworkSimulationTransformer(network_condition): |
| +def NetworkSimulationTransformer(network_condition, |
| + parent_transformer=lambda _: None): |
|
pasko
2016/04/28 15:04:59
default arg value is not needed, please remove
gabadie
2016/04/28 15:56:22
Done.
|
| """Creates a function that accepts a SandwichRunner as a parameter and sets |
| network emulation options on it. |
| Args: |
| network_condition: The network condition to apply to the sandwich runner. |
| + parent_transformer: An optional SandwichRunner transformer to use BEFORE |
| + the network condition setup. |
| Returns: |
| A callback transforming the SandwichRunner given in argument accordingly |
| @@ -29,6 +32,7 @@ def NetworkSimulationTransformer(network_condition): |
| assert network_condition in emulation.NETWORK_CONDITIONS |
| def Transformer(runner): |
| assert isinstance(runner, sandwich_runner.SandwichRunner) |
| + parent_transformer(runner) |
| runner.network_condition = network_condition |
| return Transformer |
| @@ -37,7 +41,7 @@ class SandwichTaskBuilder(task_manager.Builder): |
| """A builder for a graph of tasks, each prepares or invokes a SandwichRunner. |
| """ |
| - def __init__(self, output_directory, android_device, job_path, url_repeat): |
| + def __init__(self, output_directory, android_device, job_path): |
| """Constructor. |
| Args: |
| @@ -45,13 +49,10 @@ class SandwichTaskBuilder(task_manager.Builder): |
| android_device: The android DeviceUtils to run sandwich on or None to run |
| it locally. |
| job_path: Path of the sandwich's job. |
| - url_repeat: Non null integer controlling how many times the URLs should be |
| - repeated in the benchmarks. |
| """ |
| task_manager.Builder.__init__(self, output_directory) |
| self._android_device = android_device |
| self._job_path = job_path |
| - self._url_repeat = url_repeat |
| self._default_final_tasks = [] |
| self._original_wpr_task = None |
| @@ -221,8 +222,6 @@ class SandwichTaskBuilder(task_manager.Builder): |
| dependencies=[BuildBenchmarkCacheArchive]) |
| def RunBenchmark(): |
| runner = self._CreateSandwichRunner() |
| - # runner.record_video = True |
| - runner.job_repeat = self._url_repeat |
| runner_transformer(runner) |
| runner.wpr_archive_path = self._patched_wpr_task.path |
| runner.wpr_out_log_path = os.path.join(RunBenchmark.path, 'wpr.log') |