mirror of
https://github.com/servo/servo.git
synced 2025-09-07 21:48:21 +01:00
Update web-platform-tests to revision 4052654d786236b493d2df3cb80b9d3d1d0a8354
This commit is contained in:
parent
eab848df3e
commit
3b6ddd885a
116 changed files with 4255 additions and 821 deletions
|
@ -6,23 +6,29 @@ import threading
|
|||
from multiprocessing.managers import AcquirerProxy, BaseManager, DictProxy
|
||||
from six import text_type
|
||||
|
||||
|
||||
class ServerDictManager(BaseManager):
|
||||
shared_data = {}
|
||||
|
||||
|
||||
def _get_shared():
|
||||
return ServerDictManager.shared_data
|
||||
|
||||
|
||||
ServerDictManager.register("get_dict",
|
||||
callable=_get_shared,
|
||||
proxytype=DictProxy)
|
||||
ServerDictManager.register('Lock', threading.Lock, AcquirerProxy)
|
||||
|
||||
|
||||
class ClientDictManager(BaseManager):
|
||||
pass
|
||||
|
||||
|
||||
ClientDictManager.register("get_dict")
|
||||
ClientDictManager.register("Lock")
|
||||
|
||||
|
||||
class StashServer(object):
|
||||
def __init__(self, address=None, authkey=None):
|
||||
self.address = address
|
||||
|
@ -37,6 +43,7 @@ class StashServer(object):
|
|||
if self.manager is not None:
|
||||
self.manager.shutdown()
|
||||
|
||||
|
||||
def load_env_config():
|
||||
address, authkey = json.loads(os.environ["WPT_STASH_CONFIG"])
|
||||
if isinstance(address, list):
|
||||
|
@ -46,10 +53,12 @@ def load_env_config():
|
|||
authkey = base64.b64decode(authkey)
|
||||
return address, authkey
|
||||
|
||||
|
||||
def store_env_config(address, authkey):
|
||||
authkey = base64.b64encode(authkey)
|
||||
os.environ["WPT_STASH_CONFIG"] = json.dumps((address, authkey.decode("ascii")))
|
||||
|
||||
|
||||
def start_server(address=None, authkey=None):
|
||||
if isinstance(authkey, text_type):
|
||||
authkey = authkey.encode("ascii")
|
||||
|
@ -75,6 +84,7 @@ class LockWrapper(object):
|
|||
def __exit__(self, *args, **kwargs):
|
||||
self.release()
|
||||
|
||||
|
||||
#TODO: Consider expiring values after some fixed time for long-running
|
||||
#servers
|
||||
|
||||
|
@ -173,5 +183,6 @@ class Stash(object):
|
|||
|
||||
return value
|
||||
|
||||
|
||||
class StashError(Exception):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue