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:
Henrik Skupin 2017-03-28 22:47:43 +02:00
Родитель 5a77c8145b
Коммит 31a07e639d
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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: