diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:08:27 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:08:27 +0000 |
commit | 84e6824ab0c0b979c7f9eee493f1057cef419fa7 (patch) | |
tree | c5082fd95ac424da38659409aff0055b70376ff3 | |
parent | f6cd4c9c51a22a6e4b2f73c9bcb924e3013283a2 (diff) | |
download | chromium_src-84e6824ab0c0b979c7f9eee493f1057cef419fa7.zip chromium_src-84e6824ab0c0b979c7f9eee493f1057cef419fa7.tar.gz chromium_src-84e6824ab0c0b979c7f9eee493f1057cef419fa7.tar.bz2 |
Cleanup temp file created during a download test
BUG=
TEST=
Review URL: http://codereview.chromium.org/3322023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59256 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/functional/downloads.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/test/functional/downloads.py b/chrome/test/functional/downloads.py index 5ec5484..d05ff71 100644 --- a/chrome/test/functional/downloads.py +++ b/chrome/test/functional/downloads.py @@ -63,10 +63,11 @@ class DownloadsTest(pyauto.PyUITest): """Make a file on-the-fly with the given size. Returns the path to the file. """ - fd, file_path = tempfile.mkstemp(suffix='.zip', prefix='file-') + fd, file_path = tempfile.mkstemp(suffix='.zip', prefix='file-downloads-') os.lseek(fd, size, 0) os.write(fd, 'a') os.close(fd) + logging.debug('Created temporary file %s of size %d' % (file_path, size)) return file_path def _CallFunctionWithNewTimeout(self, new_timeout, function): @@ -360,6 +361,7 @@ class DownloadsTest(pyauto.PyUITest): os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self.PerformActionOnDownload(self._GetDownloadId(), 'cancel') + os.path.exists(file_path) and os.remove(file_path) state = self.GetDownloadsInfo().Downloads()[0]['state'] if state == 'COMPLETE': |