Bug 1304656 - Puppeteers restart method has to pass-through arguments. r=maja_zf

Puppeteer enforces to use an in_app restart, unless the clean argument is
set to True. But whatever case is present, all passed in arguments have
to be forwarded to Marionette.

MozReview-Commit-ID: ADPRvuXhyXh

--HG--
extra : rebase_source : cfc65ae082664a93abbda35b9d3a09e8af2784f0
This commit is contained in:
Henrik Skupin 2017-04-18 23:54:13 +02:00
Родитель b7bf594659
Коммит c196722774
1 изменённых файлов: 6 добавлений и 5 удалений

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

@ -60,15 +60,16 @@ class PuppeteerMixin(object):
self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
self.browser.tabbar.tabs[0].switch_to()
def restart(self, **kwargs):
def restart(self, *args, **kwargs):
"""Restart Firefox and re-initialize data.
:param flags: Specific restart flags for Firefox
"""
if kwargs.get('clean'):
self.marionette.restart(clean=True)
else:
self.marionette.restart(in_app=True)
# If no clean restart is requested, always use an in_app one
if not kwargs.get('clean'):
kwargs.update({"in_app": True})
self.marionette.restart(*args, **kwargs)
# Ensure that we always have a valid browser instance available
self.browser = self.puppeteer.windows.switch_to(lambda win: type(win) is BrowserWindow)