Chromium Code Reviews| Index: tools/android/loading/sandwich_runner.py |
| diff --git a/tools/android/loading/sandwich_runner.py b/tools/android/loading/sandwich_runner.py |
| index fb48b7cb0144d014b9fcbb47942cdcbf52289c6a..9ed8258f63ecbc827a404831d7ccfafe14b7ad3b 100644 |
| --- a/tools/android/loading/sandwich_runner.py |
| +++ b/tools/android/loading/sandwich_runner.py |
| @@ -254,3 +254,24 @@ class SandwichRunner(object): |
| self._PullCacheFromDevice() |
| self._chrome_ctl = None |
| + |
| + |
| +def WalkRepeatedRuns(runner_output_dir): |
| + """Yields unordered (repeat id, path of the repeat directory). |
|
pasko
2016/06/01 13:09:22
nice, thank you
|
| + |
| + Args: |
| + runner_output_dir: Same as for SandwichRunner.output_dir. |
| + """ |
| + repeated_run_count = 0 |
| + for node_name in os.listdir(runner_output_dir): |
| + repeat_dir = os.path.join(runner_output_dir, node_name) |
| + if not os.path.isdir(repeat_dir): |
| + continue |
| + try: |
| + repeat_id = int(node_name) |
| + except ValueError: |
| + continue |
| + yield repeat_id, repeat_dir |
| + repeated_run_count += 1 |
| + assert repeated_run_count > 0, ('Error: not a sandwich runner output ' |
| + 'directory: {}').format(runner_output_dir) |