mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
e0691cab03
- bug 1189692 - add telem for quic advertisements r=hurley (67ee0adad5) - Bug 1167809 - Add skip size check flag to cache for use with ServiceWorkers. r=mayhemer (adb2bd10ed) - Bug 1172697 - URLs containing in the query or hash should not be handled as packaged app resources r=mcmanus (2f1f079ec3) - missing unimportant bits of Bug 1166133 (08ae4d5eaa) - Bug 1153869 - altsvc assert scheme is http or https r=hurley (fa8eb33a0f) - Bug 1153924 - do not use altsvc with proxy r=hurley (4ebcef7ee5) - Bug 1170837 - Add static GetPackageURI method to PackagedAppService r=honzab (3aa5ed3ba4) - Bug 1170837 - Provide way to update packaged apps r=honzab (bba59384e3) - Bug 1172885 - nsHttpChannel::BeginConnect must call AsyncAbort in the case of an error. r=valentin (fb1950c107) - Bug 1187159 - Pass principal and flags from the requesting channel to the packaged app channel r=honzab (e2eee864ed) - Bug 1181137 - Copy all headers from base channel to subresources in the packaged app. r=honzab (481f62182b) - Bug 1165263 - Part 3: Update mozprofile to support new moz_hosts schema, r=ahal (fab842eb19) - Bug 1091274 - Move leak log functions out of automationutils and into mozbase. r=jgriffin (58ed655e98) - bug 1139922 - Fix loading mozinfo in runreftest.py. r=dbaron (23c57102ed) - restore some missing bits (1027a2f538) - Bug 1084614 - Clean up orphan servers before starting mochitests or reftests; r=kmoir (2e77777b26) - Bug 1145364 - Use more portable ps command line for orphan cleanup; r=kmoir (c4f5964e79) - Bug 1181521 - Reformat runreftest.py according to PEP8 rules, r=Ms2ger,jmaher (48d74f5782) - re-apply 817007 (03c3a3e65c) - Bug 1165263 - Part 4: Update reftest runners to support new moz_hosts schema, r=dbaron (3635819ff3) - Bug 1182487 - Add test for opening the channel with nsIRequest::INHIBIT_CACHING flag set. r=michal (4de157a608) - Bug 1190502 - RESOLVE_DISABLE_IPV4 returns A records r=mcmanus (0fbbe65166) - Bug 1172701 - Make GetSubresourceURI normalize the path for packaged resources r=mcmanus (aa8baa740d) - Bug 1144806, Fix test_temporary_storage to not depend on database sizes. r=bent. (653584241a) - Bug 1153896 - dont setup altsvc for same host/port as origin r=hurley (7294b622d7) - Bug 1170066 - Fix -Wunreachable-code-return clang warning in netwerk/protocol/http/. r=mcmanus (b0775af93d)
104 lines
3.4 KiB
Python
104 lines
3.4 KiB
Python
#
|
|
# 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/.
|
|
|
|
from __future__ import with_statement
|
|
import logging
|
|
from operator import itemgetter
|
|
import os
|
|
import platform
|
|
import re
|
|
import signal
|
|
import subprocess
|
|
import sys
|
|
import tempfile
|
|
import mozinfo
|
|
|
|
__all__ = [
|
|
'dumpScreen',
|
|
"setAutomationLog",
|
|
]
|
|
|
|
log = logging.getLogger()
|
|
def resetGlobalLog():
|
|
while log.handlers:
|
|
log.removeHandler(log.handlers[0])
|
|
handler = logging.StreamHandler(sys.stdout)
|
|
log.setLevel(logging.INFO)
|
|
log.addHandler(handler)
|
|
resetGlobalLog()
|
|
|
|
def setAutomationLog(alt_logger):
|
|
global log
|
|
log = alt_logger
|
|
|
|
# Python does not provide strsignal() even in the very latest 3.x.
|
|
# This is a reasonable fake.
|
|
def strsig(n):
|
|
# Signal numbers run 0 through NSIG-1; an array with NSIG members
|
|
# has exactly that many slots
|
|
_sigtbl = [None]*signal.NSIG
|
|
for k in dir(signal):
|
|
if k.startswith("SIG") and not k.startswith("SIG_") and k != "SIGCLD" and k != "SIGPOLL":
|
|
_sigtbl[getattr(signal, k)] = k
|
|
# Realtime signals mostly have no names
|
|
if hasattr(signal, "SIGRTMIN") and hasattr(signal, "SIGRTMAX"):
|
|
for r in range(signal.SIGRTMIN+1, signal.SIGRTMAX+1):
|
|
_sigtbl[r] = "SIGRTMIN+" + str(r - signal.SIGRTMIN)
|
|
# Fill in any remaining gaps
|
|
for i in range(signal.NSIG):
|
|
if _sigtbl[i] is None:
|
|
_sigtbl[i] = "unrecognized signal, number " + str(i)
|
|
if n < 0 or n >= signal.NSIG:
|
|
return "out-of-range signal, number "+str(n)
|
|
return _sigtbl[n]
|
|
|
|
def printstatus(status, name = ""):
|
|
# 'status' is the exit status
|
|
if os.name != 'posix':
|
|
# Windows error codes are easier to look up if printed in hexadecimal
|
|
if status < 0:
|
|
status += 2**32
|
|
print "TEST-INFO | %s: exit status %x\n" % (name, status)
|
|
elif os.WIFEXITED(status):
|
|
print "TEST-INFO | %s: exit %d\n" % (name, os.WEXITSTATUS(status))
|
|
elif os.WIFSIGNALED(status):
|
|
# The python stdlib doesn't appear to have strsignal(), alas
|
|
print "TEST-INFO | {}: killed by {}".format(name,strsig(os.WTERMSIG(status)))
|
|
else:
|
|
# This is probably a can't-happen condition on Unix, but let's be defensive
|
|
print "TEST-INFO | %s: undecodable exit status %04x\n" % (name, status)
|
|
|
|
def dumpScreen(utilityPath):
|
|
"""dumps a screenshot of the entire screen to a directory specified by
|
|
the MOZ_UPLOAD_DIR environment variable"""
|
|
|
|
# Need to figure out which OS-dependent tool to use
|
|
if mozinfo.isUnix:
|
|
utility = [os.path.join(utilityPath, "screentopng")]
|
|
utilityname = "screentopng"
|
|
elif mozinfo.isMac:
|
|
utility = ['/usr/sbin/screencapture', '-C', '-x', '-t', 'png']
|
|
utilityname = "screencapture"
|
|
elif mozinfo.isWin:
|
|
utility = [os.path.join(utilityPath, "screenshot.exe")]
|
|
utilityname = "screenshot"
|
|
|
|
# Get dir where to write the screenshot file
|
|
parent_dir = os.environ.get('MOZ_UPLOAD_DIR', None)
|
|
if not parent_dir:
|
|
log.info('Failed to retrieve MOZ_UPLOAD_DIR env var')
|
|
return
|
|
|
|
# Run the capture
|
|
try:
|
|
tmpfd, imgfilename = tempfile.mkstemp(prefix='mozilla-test-fail-screenshot_', suffix='.png', dir=parent_dir)
|
|
os.close(tmpfd)
|
|
returncode = subprocess.call(utility + [imgfilename])
|
|
printstatus(returncode, utilityname)
|
|
except OSError, err:
|
|
log.info("Failed to start %s for screenshot: %s" %
|
|
utility[0], err.strerror)
|
|
return
|