def download_and_apply_forced_update(self): self.check_update_not_applied() # The update wizard dialog opens automatically after the restart but with a short delay dialog = Wait(self.marionette, ignored_exceptions=[ NoSuchWindowException ]).until(lambda _: self.puppeteer.windows.switch_to( lambda win: type(win) is UpdateWizardDialog)) # In case of a broken complete update the about window has to be used if self.update_status['patch']['is_complete']: about_window = None try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error) dialog.close() # Open the about window and check for updates about_window = self.browser.open_about_window() update_available = self.check_for_updates(about_window) self.assertTrue(update_available, 'Available update has been found') # Download update and wait until it has been applied self.download_update(about_window) self.wait_for_update_applied(about_window) finally: self.update_status['patch'] = self.patch_info # Restart Firefox to apply the downloaded fallback update self.assertIsNotNone(about_window) self.restart( callback=lambda: about_window.deck.apply.button.click()) # For a broken partial update, the software update window is used else: try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error_patching) # Start downloading the fallback update self.download_update(dialog) finally: self.update_status['patch'] = self.patch_info # Restart Firefox to apply the downloaded fallback update self.restart(callback=lambda: dialog.wizard.finish_button.click())
def download_and_apply_forced_update(self): # The update wizard dialog opens automatically after the restart but with a short delay dialog = Wait(self.marionette, ignored_exceptions=[ NoSuchWindowException ]).until(lambda _: self.windows.switch_to( lambda win: type(win) is UpdateWizardDialog)) # In case of a broken complete update the about window has to be used if self.updates[self.current_update_index]['patch']['is_complete']: about_window = None try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error) dialog.close() # Open the about window and check for updates about_window = self.browser.open_about_window() update_available = self.check_for_updates(about_window) self.assertTrue(update_available, 'Available update has been found') # Download update and wait until it has been applied self.download_update(about_window) self.wait_for_update_applied(about_window) finally: if about_window: self.updates[ self.current_update_index]['patch'] = self.patch_info else: try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error_patching) # Start downloading the fallback update self.download_update(dialog) dialog.close() finally: self.updates[ self.current_update_index]['patch'] = self.patch_info # Restart Firefox to apply the update self.restart()
def download_and_apply_forced_update(self): # The update wizard dialog opens automatically after the restart but with a short delay dialog = Wait(self.marionette, ignored_exceptions=[NoSuchWindowException]).until( lambda _: self.windows.switch_to(lambda win: type(win) is UpdateWizardDialog) ) # In case of a broken complete update the about window has to be used if self.updates[self.current_update_index]['patch']['is_complete']: about_window = None try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error) dialog.close() # Open the about window and check for updates about_window = self.browser.open_about_window() update_available = self.check_for_updates(about_window) self.assertTrue(update_available, 'Available update has been found') # Download update and wait until it has been applied self.download_update(about_window) self.wait_for_update_applied(about_window) finally: self.updates[self.current_update_index]['patch'] = self.patch_info # Restart Firefox to apply the forced update self.restart(callback=lambda: about_window.deck.apply.button.click()) else: try: self.assertEqual(dialog.wizard.selected_panel, dialog.wizard.error_patching) # Start downloading the fallback update self.download_update(dialog) finally: self.updates[self.current_update_index]['patch'] = self.patch_info # Restart Firefox to apply the forced update self.restart(callback=lambda: dialog.wizard.finish_button.click())