def allow(self):
        """Allow the redirection."""

        self._allow_button.click()

        # Wait for the tab to load.
        # TODO: Bug 1140470: use replacement for mozmill's waitForPageLoad
        Wait(self.marionette).until(lambda _: not self.is_shown())
        win = Windows(lambda: self.marionette).current
        tab = win.tabbar.selected_tab
        Tabs(lambda: self.marionette).wait_until_loaded(tab)
예제 #2
0
    def _toggle(self, trigger="api"):
        is_open = self.is_open()

        if callable(trigger):
            trigger()
        elif trigger == "button":
            self._toolbar_button.click()
        elif trigger == "shortcut":
            window = Windows(lambda: self.marionette).current
            window.send_shortcut("r", alt=True, shift=True)
        elif trigger == "api":
            self._ensure_popup_state("closed" if is_open else "open")
        else:
            raise ValueError("Unknown trigger method: \"{}\"".format(trigger))

        (Wait(self.marionette,
              timeout=1).until(lambda _: self.is_open() is not is_open))
예제 #3
0
    def _toggle(self, trigger="api"):
        is_open = self.is_open()
        target_popup_state = "closed" if is_open else "open"

        if callable(trigger):
            trigger()
        elif trigger == "button":
            self._toolbar_button.click()
        elif trigger == "shortcut":
            window = Windows(lambda: self.marionette).current
            window.send_shortcut("r", alt=True, shift=True)
        elif trigger == "api":
            self._ensure_popup_state(target_popup_state)
        else:
            raise ValueError("Unknown trigger method: \"{}\"".format(trigger))

        if target_popup_state == "open":
            # Briefly enter the iframe to make sure the it's loaded.
            with self.in_iframe():
                pass

        (Wait(self.marionette,
              timeout=1).until(lambda _: self.is_open() is not is_open))