def __init__(self, marionette): BaseLib.__init__(self, marionette) self.app_info = AppInfo(marionette) self.prefs = Preferences(marionette) self._mar_channels = MARChannels(marionette) self._active_update = ActiveUpdate(marionette)
def __init__(self, marionette_getter, window_handle): BaseLib.__init__(self, marionette_getter) self._l10n = L10n(self.get_marionette) self._prefs = Preferences(self.get_marionette) self._windows = Windows(self.get_marionette) if window_handle not in self.marionette.chrome_window_handles: raise errors.UnknownWindowError( 'Window with handle "%s" does not exist' % window_handle) self._handle = window_handle
def download_via_update_wizard(dialog): """ Download the update via the old update wizard dialog. :param dialog: Instance of :class:`UpdateWizardDialog`. """ prefs = Preferences(lambda: self.marionette) prefs.set_pref(self.PREF_APP_UPDATE_ALTWINDOWTYPE, dialog.window_type) try: # If updates have already been found, proceed to download if dialog.wizard.selected_panel in [ dialog.wizard.updates_found_basic, dialog.wizard.updates_found_billboard, dialog.wizard.error_patching, ]: dialog.select_next_page() # If incompatible add-on are installed, skip over the wizard page # TODO: Remove once we no longer support version Firefox 45.0ESR if self.utils.compare_version(self.appinfo.version, '49.0a1') == -1: if dialog.wizard.selected_panel == dialog.wizard.incompatible_list: dialog.select_next_page() # Updates were stored in the cache, so no download is necessary if dialog.wizard.selected_panel in [ dialog.wizard.finished, dialog.wizard.finished_background, ]: pass # Download the update elif dialog.wizard.selected_panel == dialog.wizard.downloading: if wait_for_finish: start_time = datetime.now() self.wait_for_download_finished(dialog, timeout) self.download_duration = (datetime.now() - start_time).total_seconds() Wait(self.marionette).until( lambda _: (dialog.wizard.selected_panel in [ dialog.wizard.finished, dialog.wizard.finished_background, ]), message='Final wizard page has been selected.') else: raise Exception( 'Invalid wizard page for downloading an update: {}'. format(dialog.wizard.selected_panel)) finally: prefs.restore_pref(self.PREF_APP_UPDATE_ALTWINDOWTYPE)
def __init__(self, marionette): BaseLib.__init__(self, marionette) self.prefs = Preferences(marionette) self.file_path = self.marionette.execute_script(""" Components.utils.import('resource://gre/modules/Services.jsm'); let file = Services.dirsvc.get('PrfDef', Components.interfaces.nsIFile); file.append('channel-prefs.js'); return file.path; """)
def __init__(self, *args, **kwargs): BaseWindow.__init__(self, *args, **kwargs) self._prefs = Preferences(lambda: self.marionette) self._software_update = SoftwareUpdate(lambda: self.marionette) self._download_duration = None