Bug 1091270 - Move isURL out of automationutils; r=jgriffin

This commit is contained in:
Pankaj Malhotra(:bitgeeky) 2014-11-04 16:59:40 -08:00
parent 628c45fc97
commit d146c5b08b
4 changed files with 7 additions and 13 deletions

View File

@ -13,7 +13,6 @@ import signal
import subprocess
import sys
import tempfile
from urlparse import urlparse
import zipfile
import mozinfo
@ -21,7 +20,6 @@ __all__ = [
"ZipFileReader",
"addCommonOptions",
"dumpLeakLog",
"isURL",
"processLeakLog",
'KeyValueParseError',
'parseKeyValue',
@ -107,11 +105,6 @@ class ZipFileReader(object):
for name in self._zipfile.namelist():
self._extractname(name, path)
def isURL(thing):
"""Return True if |thing| looks like a URL."""
# We want to download URLs like http://... but not Windows paths like c:\...
return len(urlparse(thing).scheme) >= 2
# Python does not provide strsignal() even in the very latest 3.x.
# This is a reasonable fake.
def strsig(n):

View File

@ -7,6 +7,7 @@ Runs the reftest test harness.
"""
from optparse import OptionParser
from urlparse import urlparse
import collections
import multiprocessing
import os
@ -24,7 +25,6 @@ from automationutils import (
addCommonOptions,
dumpScreen,
environment,
isURL,
processLeakLog
)
import mozcrash
@ -786,7 +786,7 @@ Are you executing $objdir/_tests/reftest/runreftest.py?""" \
if options.xrePath is None:
options.xrePath = os.path.dirname(options.app)
if options.symbolsPath and not isURL(options.symbolsPath):
if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
options.symbolsPath = reftest.getFullPath(options.symbolsPath)
options.utilityPath = reftest.getFullPath(options.utilityPath)

View File

@ -2,13 +2,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from urlparse import urlparse
import mozinfo
import moznetwork
import optparse
import os
import tempfile
from automationutils import addCommonOptions, isURL
from automationutils import addCommonOptions
from mozprofile import DEFAULT_PORTS
here = os.path.abspath(os.path.dirname(__file__))
@ -504,7 +505,7 @@ class MochitestOptions(optparse.OptionParser):
if options.certPath:
options.certPath = mochitest.getFullPath(options.certPath)
if options.symbolsPath and not isURL(options.symbolsPath):
if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
options.symbolsPath = mochitest.getFullPath(options.symbolsPath)
# Set server information on the options object

View File

@ -12,6 +12,7 @@ import sys
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
sys.path.insert(0, SCRIPT_DIR);
from urlparse import urlparse
import ctypes
import glob
import json
@ -35,7 +36,6 @@ import bisection
from automationutils import (
environment,
isURL,
KeyValueParseError,
parseKeyValue,
processLeakLog,
@ -2125,7 +2125,7 @@ def main():
options.utilityPath = mochitest.getFullPath(options.utilityPath)
options.certPath = mochitest.getFullPath(options.certPath)
if options.symbolsPath and not isURL(options.symbolsPath):
if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
options.symbolsPath = mochitest.getFullPath(options.symbolsPath)
return_code = mochitest.runTests(options)