diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:10:28 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:10:28 +0000 |
commit | dc3e3e900426c7e620071fa4b8feebfdb6b84166 (patch) | |
tree | af08ab1b73f720ccedebd2f083f2e3c1c79b8b8f /chrome/test | |
parent | f73e174dbd1fcd3ef9ca23dbe0a4e789068ee020 (diff) | |
download | chromium_src-dc3e3e900426c7e620071fa4b8feebfdb6b84166.zip chromium_src-dc3e3e900426c7e620071fa4b8feebfdb6b84166.tar.gz chromium_src-dc3e3e900426c7e620071fa4b8feebfdb6b84166.tar.bz2 |
Fix import tests when intermediate dir might not be present
PyAuto import tests copy over saved firefox profiles from data dir to the
location where firefox stores it profile. If intermediate dirs are missing
(when firefox has never been launched on the target machine), the test
crashes. This fixes it by creating intermediate dirs.
BUG=
TEST=
Review URL: http://codereview.chromium.org/3348018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/pyautolib/pyauto_utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto_utils.py b/chrome/test/pyautolib/pyauto_utils.py index 0390497..ac37d78 100644 --- a/chrome/test/pyautolib/pyauto_utils.py +++ b/chrome/test/pyautolib/pyauto_utils.py @@ -62,6 +62,9 @@ class ExistingPathReplacer(object): self._RemoveBackupDir() def _CreateRequestedPath(self): + # Create intermediate dirs if needed. + if not os.path.exists(os.path.dirname(self._path)): + os.makedirs(os.path.dirname(self._path)) if 'dir' == self._path_type: os.mkdir(self._path) else: |