Chromium Code Reviews| Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| index da4da4027a1e16772665cc8ae55f3ae485aecdf1..dea8524422583c70bfbedf510016e6f8d42d21e9 100644 |
| --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| @@ -216,8 +216,18 @@ class LocalDeviceInstrumentationTestRun( |
| valgrind_tools.SetChromeTimeoutScale( |
| dev, self._test_instance.timeout_scale) |
| + @trace_event.traced |
|
mikecase (-- gone --)
2017/05/19 15:46:43
Maybe add this to pull_ui_screen_captures as well
aberent
2017/05/22 18:03:19
Done.
|
| + def setup_ui_capture_dir(): |
| + # Make sure the UI capture directory exists and is empty by deleting |
| + # and recreating it. |
| + capture_dir = posixpath.join(dev.GetExternalStoragePath(), |
| + 'chromium_tests_root', 'UiCapture') |
|
mikecase (-- gone --)
2017/05/19 15:46:43
nit: for indentation, I would align 'chr... with a
aberent
2017/05/22 18:03:20
Done.
|
| + if dev.PathExists(capture_dir): |
| + dev.RunShellCommand(['rm', '-rf', capture_dir]) |
| + dev.RunShellCommand(['mkdir', capture_dir]) |
| + |
| steps += [set_debug_app, edit_shared_prefs, push_test_data, |
| - create_flag_changer] |
| + create_flag_changer, setup_ui_capture_dir] |
| if self._env.concurrent_adb: |
| reraiser_thread.RunAsync(steps) |
| else: |
| @@ -244,6 +254,20 @@ class LocalDeviceInstrumentationTestRun( |
| valgrind_tools.SetChromeTimeoutScale(dev, None) |
| + if self._test_instance.ui_screenshot_dir: |
| + pull_ui_screen_captures(dev) |
| + |
| + def pull_ui_screen_captures(dev): |
| + capture_dir = posixpath.join(dev.GetExternalStoragePath(), |
| + 'chromium_tests_root', 'UiCapture') |
|
mikecase (-- gone --)
2017/05/19 15:46:43
I'm guessing this will have to be kept in sync wit
aberent
2017/05/22 18:03:20
Done.
|
| + file_names = dev.ListDirectory(capture_dir) |
| + target_path = self._test_instance.ui_screenshot_dir |
| + if not os.path.exists(target_path): |
| + os.makedirs(target_path) |
| + |
| + for file_name in file_names: |
| + dev.PullFile(posixpath.join(capture_dir, file_name), target_path) |
|
mikecase (-- gone --)
2017/05/19 15:46:43
Even though the name doesn't make it seem like it,
aberent
2017/05/22 18:03:20
So I thought originally. The problem is that PullF
|
| + |
| self._env.parallel_devices.pMap(individual_device_tear_down) |
| def _CreateFlagChangerIfNeeded(self, device): |