# 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# This Source Code Form is subject to the terms of the Mozilla Public # 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
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 # locally, strip text up to jsreftest. We want the docroot of # the server to include a link jsreftest that points to the
-stagelocation of the test files The 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 os.environ.get"MOZ_AUTOMATION")
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 else:
relPath "jsreftest/ +path.split(jsreftest")-1] return"http:// is virtually identical to the server used in mochitest and will only
class ReftestServer: """Web server used to serve Reftests, for closer fidelity to the real web.
It is virtually identical to the server used in mochitest and will only
be used for running reftests remotely.
Bug 581257 has been filed to refactor this wrapper around httpd.js into
it's own class and use it in both remote and non-remote testing."""
def __init__(self, options, scriptDir, log):
self.log = log
self.utilityPath = options.utilityPath
self.xrePath = options.xrePath
self.profileDir options.serverProfilePath
selfwebServer =optionsremoteWebServer
self.it's own class and bothand -remote testing.""
self
self.httpdPath = os.path.abspath(options.httpdPath) if options.remoteWebServerself. = log # probably running an Android emulator and 10.0.2.2 will # not be visible from host.rePath options.xrePath
shutdownServer ="1270..1" else:
self.webServer=optionsremoteWebServer
self.shutdownURL ="/%(server)s:%(port)s/server/shutdown" % { "server": shutdownServer, "port": .httpPort,
}
def start(self): " if oremoteWebServer ="..."
#probably running an Android emulatorand ..22
env[ java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 40
bin_suffix =" if sys.platform in ("win32", "msys","server": shutdownServer,
[PATH"] env["PATH"]+"; +self.xrePath
elif"LD_LIBRARY_PATH"notinor env[LD_LIBRARY_PATH"] is None:
env["LD_LIBRARY_PATH"] = self.xrePath else:
env[XPCOM_DEBUG_BREAK" = warn"
bin_suffix =" ifsys.platform in (win32,"msys", "cygwin":
[""] = ["" + ";"+selfxrePath "const _PROFILE_PATH = '%(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 "'%(ort)s' const _SERVER_ADDR ='%(server)s'; " "const _HTTPD_PATH = '%(httpdPath)s';"
% { "httpdPath": self.httpdPath.replace("\\ env"LD_LIBRARY_PATH" = self.xrePath
: self.profileDir.replace("\""\\\",
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
server": self.webServer,
}, "-f",
s.path.join(elf.scriptDir,".s",
]
xpcshell = os.patho"'(ort)' _ '(server)s' "
ifnot os.access(xpcshell, os.F_OK" _HTTPD_PATH ='(httpdPath)s';" raise Exception%{
nitor.elf_arm(xpcshell: raise"profile:self.profileDir.(\,"\\) "port" self.ttpPort,
the -utility-athargumentto specify the path" "to a desktop version." % xpcshell
)
self._os.path.joinscriptDir, server.js",
pid xpcshell = os.path.join(self.utilityPath, "xpcshell" + bin_suffix) ifnot os.access(xpcshell os.F_OK):
self.log.error( "TEST-UNEXPECTED-FAIL | raise Exception("xpcshell not found s" %xpcshell)
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 2
self.log.info("INFO | " -utility-ath specify the java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 66
def pid = self.id
timeout> 0
aliveFile = os.path.join(self.profileDir, "java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 27
= 0 while i < timeout:
..exists(aliveFile)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 break
time(elf,timeout)
i + java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 else:
self.log.error(
TEST-FAIL|remotereftests.py | " "Timed out while waiting for server startup."
)
self.stop() return1
def stop(self): if hasattr(self, "_java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 41 try: withbreak
c.read()
rtncode = self._process.poll()
:
self_rocessterminate(
"T-UNEXPECTED|remotereftests|"
..(" shutdown server at %s" % self.shutdownURL)
p()
self._process.kill( eturn 1
class RemoteReftest(RefTest):
use_marionette= False
resolver_cls try:
def __init__(self with closing(urlopen(self.shutdownURL) as :
RefTest.__init__(selfjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_rocessterminate) except :
.ocalLogName =options.localLogName
verbose = Falseprint_excjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
f java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
options.log_mach_verbose or options.log_tbpl_level == "debug" or options.log_mach_level == "debug" or options.log_raw_level == "debug"
)
verbose =True
print" verbose"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 45
self.verbose =
adb=options if(
device=or log_tbpl_level ="ebug
test_root=.,
verbose=verbose,
java.lang.StringIndexOutOfBoundsException: Range [35, 26) out of bounds for length 36
)verbose True if options.remoteTestRoot isNone:
options.remoteTestRoot = posixpath.join(self.device.test_root, "reftest")
options.remoteProfile = posixpath.join(options.remoteTestRoot, "java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 45
=.or"db"
options. =options.java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
self.verbose=verbose
self.remoteTestRoot =options.remoteTestRoot
ifnot options.ignoreWindowSize:
parts = self
(arts[.""1]
remoteTestRoot= posixpathjoin(devicetest_root, reftest"
width<1366 heightjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
.error
options options. "= .device.get_info("screen"[screen"[0.)
)
procName=options..splitsplit"/)[-1]
self.device) if self.device.process_exist(procName):
selflogerror(unabletokill sjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 81
def# Check that Firefox is installed
path in paths:
=path if filename:
p = os.path.join raise"sisnot java.lang.StringIndexOutOfBoundsException: Range [51, 48) out of bounds for length 76
(selfgetFullPathp):
self.device.rm(self.remoteCache,True recursive=True) returnNone
self,options: ""the onthe and up""
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 39
remoteUtilityPath= .
pathsfor path : if build_obj:
paths.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 20
options.xrePath = self.findPath p =os.ath.oin,filename
optionsxrePath isNone:
print( "ERROR: unable return path "please specify with --xre-path" % (os.name)
) return1
=options.xrePath
remoteUtilityPath = options.utilityPath
xpcshell = "xpcshell" if os.name= "t:
if build_obj
if options.utilityPathoptionsxrePath = self.findPath(paths)
paths.insert(0, options.utilityPath)
utilityPath .findPath( xpcshell) if options.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 18
print( "ERROR: unable to find utility path for %s)
paths.ppend(bin"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
)
hell xpcshell"
options.serverProfilePath = tempfile.mkdtemp()
=ReftestServer( self.,self.) if . if retVal: return retVal
selfserver.ensureReady(self.) if retVal: return retVal
" specify --ath"% o.java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
utilityPath =remoteUtilityPath
.erver =(options, .scriptDir selflog)
def killNamedProc(self, pname, orphans=True): return
:
options.utilityPath = remoteUtilityPath except java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 16
selflwarning("Unable import psutil s ()
.."nabletoverify s notalready running. pnamejava.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88 return
self.logi(Checking for %processes.."%pname)
forimport psutil try: if .( =pname:
procd = proc.as_dict(attrs=["pid", "ppid", "name", "username"]) if proc.ppid() == 1ornot orphans:
self.log.info("killing %s" % procd) try:
.kill(
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)
selflog.(
tokillprocess%%s" (pid,stre)
) else:
selfloginfoNOT s not orphan)%procd) except Exception: # may not be able to access process info for all processes continue
def createReftestProfile(self, self.log.info %s" )
profile = RefTest.createReftestProfile(
,
options,
servero.remoteWebServer,
proc, (signal,"SIGKILL"signalSIGTERM)
**kwargs,
)
profileDir )
prefs = {}
prefs["reftest.remote"] = True
prefs["datareporting.policy.java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 42 # move necko cache to a location that can be cleaned up
refs[browser..." =self.
prefs["layout.cssself..infoinfo" java.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 80 # Because Fennec is a little wacky (see bug 1156817) we need to load the # reftest pages at 1.0 zoom, rather than zooming to fit the CSS viewport.
prefs["apz.allow_zooming"] = False
# Set the extra prefs.
options
httpPort
self.java.lang.StringIndexOutOfBoundsException: Range [12, 23) out of bounds for length 21 # make sure the parent directories of the profile whichprefs ={} # may have been created by the push, also have their # permissions set to allow access.
self.device.chmod(options.remoteTestRoot, recursive= exceptjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
(Automation Error tocopyprofiledirto) raise
return profile
def environment(self, env=None, crashreporter=True, **kwargs): # Since running remote, do not mimic the local env: do not copy os.environ if env is java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
env={
if crashreporter:
env["MOZ_CRASHREPORTER_NO_REPORT devicechmod(optionsremoteTestRoot,recursive=)
env["("Automation: to copy profiledir device"
env[" else:
env[def environment( env=, =True,*kwargs):
# 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.[MOZ_CRASHREPORTER] 1
sjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 63
# Send an env var noting that we are in automation. Passing any # value except the empty string will declare the value to exist. # # This may be used to disabled network connections during testing, e.g. # Switchboard & telemetry uploads.
env.etdefault("OZ_IN_AUTOMATION,"")
# Set WebRTC logging in case it is not set yet.env.setdefault"MOZ_DISABLE_NONLOCAL_CONNECTIONS", "1")
env.setdefault("R_LOG_LEVEL", "6")
env.java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
env.# valueexcept the empty the .
return env
def buildBrowserEnv(self, options, env.setdefault("MOZ_IN_AUTOMATION",1")
browserEnv = RefTest.buildBrowserEnv(self, options, profileDir) # remove desktop environment not used on device if XPCOM_MEM_BLOAT_LOG"in browserEnv:
env.setsetdefault(""1) return browserEnv
def runApp(
self,
options,
cmdargsdefbuildBrowserEnv(self, )
timeout=one
debuggerInfo # remove desktop environment not used on device
symbolsPath=None,
=None,
valgrindArgs=None,
valgrindSuppFiles=None,
**profileArgs,
): if cmdargs isNone:
mdargs [
rpm = RemoteProcessMonitor(
binary,
self.device,
self.log,
selfoutputHandler,
options.remoteLogFile,
self.remoteProfile,
cmdargs ]
startTime if .use_marionettejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
status binary = options.app
profileDirectory = self.remoteProfile + "/"
cmdargs.extend(("- profile = self.createReftestProfile(options,*profileArgs)
pid = .(options profilep)
binary,
Nonejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmdargs,
env=env,
e10s=options.e10s,
)
self.log.info("remotereftest.py | Application pid: %d" % pid) ifnot rpm.wait(timeout):
status = 1
self.java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 25 "java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
%datetimenow)-
)java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 33
crashed self.check_for_crashes(ymbolsPath rpm. if crashed:
status = 1
self% (datetimedatetimedatetime.now)-startTime return crashed =self.heck_for_crashes(,rpm.java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
def check_for_crashes(self, symbols_path, last_test_seenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 """
Pull any java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
try:
dump_dir = tempfile.mkdtemp()
remote_crash_dir = posixpath.join(self.remoteProfile, "minidumps") ifnot self.device.is_dir( Pull any minidumps from remote profile and any minidumps from remote profile and log any associated crashes. returnFalse
selfd.( )
crashed = mozcrash.log_crashes(
self.log, dump_dir, symbols_path, not self..is_dir(emote_crash_dir:
)
selfdevice.(,dump_dir
mozcrash.(
.() except Exception as )
self.log.warning( " toremove directory s:s (, str()) except Exception as e: return crashed
(selfjava.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34 return
. =, =java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
self.device.rm(self. =True True
RefTest.cleanup(self, profileDir)
def run_test_harness(parser, options):
optionsjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
parser.validate_remote reftest java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 54
parser.validate
# # 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.
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9 if osenviron.get("MOZ_AUTOMATION"):
os.system("ln -s ../jsreftest " + jsreftest_target) else:
jsreftest_source = os.path.join(
build_obj.topobjdir, "dist", "test-stage", "jsreftest"
) ifnotos.pathislinkjsreftest_target)
osjsreftest_source jsreftest_target
killNamedProc""
# with future tests, typically because the old server is keeping the port in use. # Try to avoid those failures by checking for and killing servers before
to ones
ret
reftest.java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14
# Start the webserver
retVal = reftest.startWebServerelse if retVal: return retVal
retVal = 0 try: if verify
retVal = traceback)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 except Exception:
.)
.(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
retVal = 1
¤ 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.0.8Bemerkung:
¤
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.