Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/test/chromedriver/util.py

Issue 137423013: [chromedriver] Enable a java test and fix binary path like "~/chrome". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for manual commit Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/chromedriver/test/test_expectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic utilities for all python scripts.""" 5 """Generic utilities for all python scripts."""
6 6
7 import atexit 7 import atexit
8 import httplib 8 import httplib
9 import os 9 import os
10 import signal 10 import signal
(...skipping 21 matching lines...) Expand all
32 32
33 33
34 def IsLinux(): 34 def IsLinux():
35 return sys.platform.startswith('linux') 35 return sys.platform.startswith('linux')
36 36
37 37
38 def IsMac(): 38 def IsMac():
39 return sys.platform.startswith('darwin') 39 return sys.platform.startswith('darwin')
40 40
41 41
42 def GetAbsolutePathOfUserPath(user_path):
43 """Expand the given |user_path| (like "~/file") and return its absolute path.
44 """
45 if user_path is None:
46 return None
47 return os.path.abspath(os.path.expanduser(user_path))
48
49
42 def _DeleteDir(path): 50 def _DeleteDir(path):
43 """Deletes a directory recursively, which must exist.""" 51 """Deletes a directory recursively, which must exist."""
44 # Don't use shutil.rmtree because it can't delete read-only files on Win. 52 # Don't use shutil.rmtree because it can't delete read-only files on Win.
45 for root, dirs, files in os.walk(path, topdown=False): 53 for root, dirs, files in os.walk(path, topdown=False):
46 for name in files: 54 for name in files:
47 filename = os.path.join(root, name) 55 filename = os.path.join(root, name)
48 os.chmod(filename, stat.S_IWRITE) 56 os.chmod(filename, stat.S_IWRITE)
49 os.remove(filename) 57 os.remove(filename)
50 for name in dirs: 58 for name in dirs:
51 os.rmdir(os.path.join(root, name)) 59 os.rmdir(os.path.join(root, name))
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 192
185 193
186 def AddLink(label, url): 194 def AddLink(label, url):
187 """Adds a link with name |label| linking to |url| to current buildbot step. 195 """Adds a link with name |label| linking to |url| to current buildbot step.
188 196
189 Args: 197 Args:
190 label: A string with the name of the label. 198 label: A string with the name of the label.
191 url: A string of the URL. 199 url: A string of the URL.
192 """ 200 """
193 print '@@@STEP_LINK@%s@%s@@@' % (label, url) 201 print '@@@STEP_LINK@%s@%s@@@' % (label, url)
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/test/test_expectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698