From f9310fe2be460e2cefd844cd0f53f3e2b9f3488b Mon Sep 17 00:00:00 2001 From: kkinnunen Date: Sun, 29 Mar 2015 22:33:16 -0700 Subject: webpages_playback.py: Avoid crash when retrying to capture skp Move the .wpr files after recording, in the recording retry loop. Previously they were moved in the skp capture retry loop. Review URL: https://codereview.chromium.org/1033223005 --- tools/skp/webpages_playback.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tools/skp') diff --git a/tools/skp/webpages_playback.py b/tools/skp/webpages_playback.py index 422edbcc36..d9635b6960 100644 --- a/tools/skp/webpages_playback.py +++ b/tools/skp/webpages_playback.py @@ -222,6 +222,17 @@ class SkPicturePlayback(object): for _ in range(RETRY_RECORD_WPR_COUNT): try: shell_utils.run(' '.join(record_wpr_cmd), shell=True) + + # Move over the created archive into the local webpages archive + # directory. + shutil.move( + os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, wpr_data_file), + self._local_record_webpages_archive_dir) + shutil.move( + os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, + page_set_json_name), + self._local_record_webpages_archive_dir) + # Break out of the retry loop since there were no errors. break except Exception: @@ -261,17 +272,6 @@ class SkPicturePlayback(object): # captured SKP is still valid. This is a known issue. pass - if self._record: - # Move over the created archive into the local webpages archive - # directory. - shutil.move( - os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, wpr_data_file), - self._local_record_webpages_archive_dir) - shutil.move( - os.path.join(LOCAL_REPLAY_WEBPAGES_ARCHIVE_DIR, - page_set_json_name), - self._local_record_webpages_archive_dir) - # Rename generated SKP files into more descriptive names. try: self._RenameSkpFiles(page_set) -- cgit v1.2.3