summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib/pyauto.py
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 19:02:46 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 19:02:46 +0000
commit4ca8b39fcc18d80948ab02db41d6ca632ad446db (patch)
tree7bc06e0cb6de732d545b52895e3523c0034f5c89 /chrome/test/pyautolib/pyauto.py
parentaca02cf3af06c48baa7f6b7f82d319ffc848fac6 (diff)
downloadchromium_src-4ca8b39fcc18d80948ab02db41d6ca632ad446db.zip
chromium_src-4ca8b39fcc18d80948ab02db41d6ca632ad446db.tar.gz
chromium_src-4ca8b39fcc18d80948ab02db41d6ca632ad446db.tar.bz2
1. Fix GetFileURLForPath for windows. GetFileURLForPath() should not quote() ':' in the drive letter on windows.
2. Fix testCrazyFilenames test for win. Expand crazy_filenames.txt to contain i18n filenames as ascii strings. 3. Disable bookmark_bar.testBookmarkBarVisible on win 4. Get rid of using hashlib module in dowload tests. Since we have the files, it doesn't make sense to compute checksum to verify if 2 files are the same -- direct comparison will do. Review URL: http://codereview.chromium.org/1780013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib/pyauto.py')
-rw-r--r--chrome/test/pyautolib/pyauto.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index e8975126..ddf6bc9 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -166,8 +166,16 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
Also quotes the url using urllib.quote().
"""
- abs_path = urllib.quote(os.path.abspath(path).replace('\\', '/'))
- return 'file://' + abs_path
+ abs_path = os.path.abspath(path)
+ if sys.platform == 'win32':
+ # Don't quote the ':' in drive letter ( say, C: ) on win.
+ # Also, replace '\' with '/' as expected in a file:/// url.
+ drive, rest = os.path.splitdrive(abs_path)
+ quoted_path = drive.upper() + urllib.quote((rest.replace('\\', '/')))
+ return 'file:///' + quoted_path
+ else:
+ quoted_path = urllib.quote(abs_path)
+ return 'file://' + quoted_path
def WaitUntil(self, function, timeout=-1, retry_sleep=0.25, args=[]):
"""Poll on a condition until timeout.