Bug 1304656 - Puppeteers restart method has to pass-through arguments. draft
authorHenrik Skupin <mail@hskupin.info>
Tue, 18 Apr 2017 23:54:13 +0200
changeset 564712 de83c85b86ecacfeeef588b59db09eded4b6ca25
parent 564098 bb38d935d699e0529f9e0bb35578d381026415c4
child 564713 45363ab9935fb123dc0e963d62d0a61315399b8b
push id54672
push userbmo:hskupin@gmail.com
push dateTue, 18 Apr 2017 21:56:46 +0000
bugs1304656
milestone55.0a1
Bug 1304656 - Puppeteers restart method has to pass-through arguments. 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
testing/marionette/puppeteer/firefox/firefox_puppeteer/mixins.py
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/mixins.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/mixins.py
@@ -55,25 +55,26 @@ class PuppeteerMixin(object):
             # tests a proper start condition and make them not fail.
             self.puppeteer.windows.close_all([self.browser])
             self.browser.focus()
 
             # Also close all remaining tabs
             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)
 
     def setUp(self, *args, **kwargs):
         super(PuppeteerMixin, self).setUp(*args, **kwargs)
 
         self._start_handle_count = len(self.marionette.window_handles)