зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1348872
- Wait() should accept None as timeout and interval. r=ato
Setting the default value for both the timeout and interval should not be done in the parameter list, but dependent on if None is passed in or not. MozReview-Commit-ID: 4VwHfTkrwDk --HG-- extra : rebase_source : 31abac0cf53e9035296462360d316d856fed5689
This commit is contained in:
Родитель
5a77c8145b
Коммит
31a07e639d
|
@ -29,8 +29,8 @@ class Wait(object):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, marionette, timeout=DEFAULT_TIMEOUT,
|
||||
interval=DEFAULT_INTERVAL, ignored_exceptions=None,
|
||||
def __init__(self, marionette, timeout=None,
|
||||
interval=None, ignored_exceptions=None,
|
||||
clock=None):
|
||||
"""Configure the Wait instance to have a custom timeout, interval, and
|
||||
list of ignored exceptions. Optionally a different time
|
||||
|
@ -71,10 +71,10 @@ class Wait(object):
|
|||
"""
|
||||
|
||||
self.marionette = marionette
|
||||
self.timeout = timeout
|
||||
self.timeout = timeout if timeout is not None else DEFAULT_TIMEOUT
|
||||
self.interval = interval if interval is not None else DEFAULT_INTERVAL
|
||||
self.clock = clock or SystemClock()
|
||||
self.end = self.clock.now + self.timeout
|
||||
self.interval = interval
|
||||
|
||||
exceptions = []
|
||||
if ignored_exceptions is not None:
|
||||
|
|
Загрузка…
Ссылка в новой задаче