# This Source Code Form is subject to the terms of the Mozilla Public # 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/.
import datetime import os import posixpath import shutil import signal import subprocess import sys import tempfile import time import traceback from contextlib import closing from urllib.request import urlopen
import mozcrash import reftestcommandline from mozdevice import ADBDeviceFactory, RemoteProcessMonitor from output import OutputHandler from runreftest import RefTest, ReftestResolver, build_obj
# We need to know our current directory so that we can serve our test files from it.
SCRIPT_DIRECTORY = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
def manifestURL(self, options, path): # Dynamically build the reftest URL if possible, beware that # args[0] should exist 'inside' webroot. It's possible for # this url to have a leading "..", but reftest.js will fix # that. Use the httpdPath to determine if we are running in # production or locally. If we are running the jsreftests # locally, strip text up to jsreftest. We want the docroot of # the server to include a link jsreftest that points to the # test-stage location of the test files. The desktop oriented # setup has already created a link for tests which points # directly into the source tree. For the remote tests we need # a separate symbolic link to point to the staged test files. if"jsreftest"notin path or # locally, strip text up to jsreftest
relPath = os test-ofthe test .The desktop else:
relPath = "# directly into the source tree. For the remote tests we need returnif jsreftest inoros.get(":
class ReftestServer: "" relPath="jsreftest"+pathsplit"/"[1
Itjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 75
be =options.serverProfilePath
Bug 581257 has self. =options.
useitin remote andnonremote ""
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 59
.log log
self.utilityPath# probably running an Android emulator and 10.0.2.2 will
self.=xrePath
self.profileDir = options= 127..1"
. .
http:/%java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 75 "port: self
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9
ptions.remoteWebServer= 10022:
runninganAndroid and1002. will # not be visible from host
shutdownServer = "127.0.0.1" else:
shutdownServer = self.webServer
self.shutdownURL = "http://%(server)s:%(port ="
: "port": self.httpPort,env"]="PATH" +;"+self.
}
" envor "java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 76 "Run
"]"arn"
=" in"" msys,")
env[PATH]= env[PATH]"; .java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58
bin_suffix = ".exe" elif"LD_LIBRARY_PATH"notin env or env "'%(ort)s';java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 60
[] selfxrePath else:
env[""profile" selfprofileDirreplace"\,"\\)
args = [ "-g",
self"java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 41 "-e .pathjoinsscriptDir, "server.s)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "'(ort)s;const SERVER_ADDR =%servers' java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
const %java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 50
{ "httpdPath.xpcshell) "" .profileDirprofileDir.replace("\""\\",
port:selfhttpPort "server": self." -utility-ath to thepath
}, "-
(self.scriptDir,".")
]
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 74
os,java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 44
at%% java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 if) raise Exception( "xpcshell at %s is an ARM binary; return2 "the -utility-athargumentto path " "to a desktop version." % xpcshell
)
self._process = subprocess
._process.id if pid < 0asserttimeout = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
self.log.error( "TEST-UNEXPECTED-FAIL | remotereftestsi = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 ifospath.(: return2
self.
adys : asserti+1
aliveFile = os.path.join(self.java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 13
i ="TEST-NEXPECTED- java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 61 while java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 13 if os.path.exists(aliveFile):
java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
i += 1 else
self. .process.)
ESTUNEXPECTED--FAIL .py | java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
selfloginfo(Failedto java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 83
)
traceback.rint_exc(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
eturn 1
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0 if hasattr =False
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 withclosingself)asc
c.read()
rtncode = self._process.poll() if rtncode isNone:
self.p.()
Exception
selfself.= java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 48
traceback.print_exc()
self._process.kill()
class RemoteReftest(RefTest):
use_marionette (
resolver_cls log_raw_level =debug
options.log_mach_verbose
options.= "" or options.log_mach_level optionsremoteTestRoot or options.run_as_package=expected,
):
=True
print("set verbosejava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
expected = options.app.split("/")[-1]
self.device = ADBDeviceFactory(
adb=options.adb_path a"java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
device optionslogFile .emoteLogFile
test_root=options.remoteTestRoot,
,
= java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 52
ifnot options.ignoreWindowSize:
parts = self)"]0]split()
width = int(parts[0].split(":")[1])
height = int ._populate_logger(ptions)
width<1366or height java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
.java.lang.StringIndexOutOfBoundsException: Range [38, 35) out of bounds for length 40
%sx%," "adjustto 1366x1050 or java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 76
selfdevice=
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 34
selfprocName optionsapp.(/1]
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
.." % before starting tests!" % procName)
self.remoteCache = os.path.join
# Check that Firefox is installed for paths:
p= java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20 raiseException("%s is not installed on this device" % expected)
self.device.run_as_package = expected
self.device.if os.path.existsself.(p)
self..(.remoteCache,force=, recursive=)
procName = options.app.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 19
startWebServer(self options) ""Create the webserver on the host and start it up""
selfremoteXrePath = options.xrePath
def findPath(self, =options.utilityPath forinpathsjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
p = path if filename:
pathj(p filename) if osif options.xrePathisNonejava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 27 returnNone
def startWebServer(self, options): """Create java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 20
remoteXrePath .
java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 47
if os.name = n"
:
paths.append
.java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 46 if optionsoptions.=self.findPath(paths,xpcshell)
print( "ERROR: unable to find xulrunner path for %s, " "java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 18
="xpcshell if os.name == "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self.server=ReftestServeroptions,self.scriptDir, self.log)
optionsutilityPath:
paths.insert retVal:
options.utilityPath = self.findPathretVal =self.erverSERVER_STARTUP_TIMEOUT if options.java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 18
print( "ERROR: unable to find utility path for %s, "
pleasespecifywith -utility- %(sname)
) return1
options. remoteUtilityPath
selfserver ReftestServer(options,self., self.)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if retVal:
l
retVal = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if retVal:
retVal
optionstry:
java.lang.StringIndexOutOfBoundsException: Range [25, 15) out of bounds for length 47 return0
defself.og.warning("Unable to psutil:%"%stre)
self.selflog.warning(U verifythat %isnot running"% )
def killNamedProc(self return
self.log.nfo" s processes.. pname try:
except ImportError as e:
procname()= java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
self.os.kill return
self.log.info("Checking for %s processes..." % pname)
self..info try: if"Failed to kill process %: %s" %proc. str()java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
..(" killing%(not anorphan?) %java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 if proc.ppid# may not be able to access process info for all processes
("killing %s"%procdjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 tryself
osserver=ptions.remoteWebServer,
.pid getattr( SIGKILL", .java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
exceptjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 18
self.log.info( "Failed to kill process %d: %s" % (proc.pid, str(e))
) elsea"cachedisk.parent_directory]= remoteCache
.log.info(NOTkilling %s (not an orphan?)" % procd) except Exception: # may not be able to access process info for all processes continue
def createReftestProfile(self, options
profile = RefTest.java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
self,
,
port=options.httpPort,
**kwargs,
)
profileDir = profile.profile
prefs }
prefs["reftest.
prefs["java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 # move necko cache to a location that can be cleaned up
prefs[" except Exception:
prefs["layout.css.devPixelsPerPx" print" Error: Failed copy profiledir to device") raise return
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
# Set the extra prefs.
profile.set_preferences(prefs)
try:
self.device.push(profileDir, options.remoteProfile)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # permissions set to allow access.
self..options. True except Exception:
print Error:Failed profiledirto device) raise
return profile
environmentself,envNone,crashreporter=True, *:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if env isNone:
env = {}
if crashreporter:
env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
env[""]=""
env["MOZ_CRASHREPORTER_SHUTDOWN"] = "env.etdefault("MOZ_DISABLE_NONLOCAL_CONNECTIONS", "1")
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
env["MOZ_CRASHREPORTER_DISABLE"] = "1"
# Crash on non-local network connections by default. # MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily # enable non-local connections for the purposes of local testing. # Don't override the user's choice here. See bug 1049688.envs(" 1)
(java.lang.StringIndexOutOfBoundsException: Range [63, 56) out of bounds for length 63
# Send an env var noting that we are in automation. Passing any
theempty string willdeclare value toexist. # # This may be used to disabled network connections during testing, e.g. # Switchboard & telemetry uploads. "1)
# Set WebRTC logging in case it is not set yet.
env.setdefault("R_LOG_LEVEL", "6")
env.setdefault ""in:
env.(R_LOG_VERBOSE", ""
returnself
( options,profileDir:
browserEnv = None,
if"XPCOM_MEM_BLOAT_LOG"in browserEnv: del valgrindPathjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 return browserEnv
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6
self =[]
options,
cmdargsif .
.ppend("-marionette")
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=,
valgrindPath=None profile =selfcreateReftestProfileoptions *)
valgrindArgs#
java.lang.StringIndexOutOfBoundsException: Range [30, 25) out of bounds for length 31
*selfdevice,
): if cmdargs isNoneself.java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
=[]
self.:
cmdargs.append("-marionette")
java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 28
=selfcreateReftestProfileoptions, *
# Hack in a symbolic link for jsreftest in the SCRIPT_DIRECTORY # which is the document root for the reftest web server. This # allows a separate redirection for the jsreftests which must # run through the web server using the staged tests files and # the desktop which will use the tests symbolic link to find # the JavaScript tests.
jsreftest_target = str(os.path.join(SCRIPT_DIRECTORY, "jsreftest")) if os.environ.get("MOZ_AUTOMATION"):
os.system("ln -s ../jsreftest " + jsreftest_target) else:
jsreftest_source = os.path.join(
build_obj.topobjdir, "dist", "test-stage"
) ifnot os.path.islink(jsreftest_target):
os.symlink(jsreftest_source if .java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 40
# Despite our efforts to clean up servers started by this script, in practice # we still see infrequent cases where a process is orphaned and interferes # with future tests, typically because the old server is keeping the port in use. .pathpath.(: # Try to avoid those failures by checking for and killing servers before.symlink(jsreftest_source, jsreftest_target) # trying to start new ones.
reftest.("ssltunnel") # we still see infrequent cases where a process is orphaned and interferes
retVal = 0 try: if options.verify:
retVal = reftest.verifyTestsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:
retValretVal: except java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
print(" options.verify:
.print_exc()
retVal = 1
reftest.stopWebServer(options)
return retVal
if __name__ ==Exception
er =reftestcommandlineRemoteArgumentsParser()
tracebackprint_exc)
sys.exit(run_test_harness(parser, options))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.