예제 #1
0
    def __init__(self, android_platform_backend, browser_options,
                 backend_settings):
        assert isinstance(
            android_platform_backend,
            android_platform_backend_module.AndroidPlatformBackend)
        super(AndroidBrowserBackend, self).__init__(
            android_platform_backend,
            supports_tab_control=backend_settings.supports_tab_control,
            supports_extensions=False,
            browser_options=browser_options)

        self._port_keeper = util.PortKeeper()
        # Use the port hold by _port_keeper by default.
        self._port = self._port_keeper.port

        extensions_to_load = browser_options.extensions_to_load

        if len(extensions_to_load) > 0:
            raise browser_backend.ExtensionsNotSupportedException(
                'Android browser does not support extensions.')

        # Initialize fields so that an explosion during init doesn't break in Close.
        self._backend_settings = backend_settings
        self._saved_sslflag = ''
        self._app_ui = None

        # Set the debug app if needed.
        self.platform_backend.SetDebugApp(self._backend_settings.package)
  def __init__(self, android_platform_backend, browser_options,
               backend_settings, output_profile_path, extensions_to_load,
               target_arch):
    assert isinstance(android_platform_backend,
                      android_platform_backend_module.AndroidPlatformBackend)
    super(AndroidBrowserBackend, self).__init__(
        android_platform_backend,
        supports_tab_control=backend_settings.supports_tab_control,
        supports_extensions=False, browser_options=browser_options,
        output_profile_path=output_profile_path,
        extensions_to_load=extensions_to_load)

    self._port_keeper = util.PortKeeper()
    # Use the port hold by _port_keeper by default.
    self._port = self._port_keeper.port


    if len(extensions_to_load) > 0:
      raise browser_backend.ExtensionsNotSupportedException(
          'Android browser does not support extensions.')

    # Initialize fields so that an explosion during init doesn't break in Close.
    self._backend_settings = backend_settings
    self._target_arch = target_arch
    self._saved_sslflag = ''

    # TODO(wuhu): Move to network controller backend.
    self.platform_backend.InstallTestCa()

    # Kill old browser.
    self._KillBrowser()

    if self.device.HasRoot() or self.device.NeedsSU():
      if self.browser_options.profile_dir:
        self.platform_backend.PushProfile(
            self._backend_settings.package,
            self.browser_options.profile_dir)
      elif not self.browser_options.dont_override_profile:
        self.platform_backend.RemoveProfile(
            self._backend_settings.package,
            self._backend_settings.profile_ignore_list)

    if self.browser_options.netsim:
      assert self.platform_backend.use_rndis_forwarder, (
          'Netsim requires RNDIS forwarding.')
      self.wpr_port_pairs = forwarders.PortPairs(
          http=forwarders.PortPair(0, 80),
          https=forwarders.PortPair(0, 443),
          dns=forwarders.PortPair(0, 53))

    # Set the debug app if needed.
    self.platform_backend.SetDebugApp(self._backend_settings.package)
예제 #3
0
    def __init__(self, android_platform_backend, browser_options,
                 backend_settings):
        assert isinstance(
            android_platform_backend,
            android_platform_backend_module.AndroidPlatformBackend)
        super(AndroidBrowserBackend, self).__init__(
            android_platform_backend,
            supports_tab_control=backend_settings.supports_tab_control,
            supports_extensions=False,
            browser_options=browser_options)

        self._port_keeper = util.PortKeeper()
        # Use the port hold by _port_keeper by default.
        self._port = self._port_keeper.port

        extensions_to_load = browser_options.extensions_to_load

        if len(extensions_to_load) > 0:
            raise browser_backend.ExtensionsNotSupportedException(
                'Android browser does not support extensions.')

        # Initialize fields so that an explosion during init doesn't break in Close.
        self._backend_settings = backend_settings
        self._saved_sslflag = ''
        self._app_ui = None

        # Stop old browser, if any.
        self._StopBrowser()

        if self.device.HasRoot() or self.device.NeedsSU():
            if self.browser_options.profile_dir:
                self.platform_backend.PushProfile(
                    self._backend_settings.package,
                    self.browser_options.profile_dir)
            elif not self.browser_options.dont_override_profile:
                self.platform_backend.RemoveProfile(
                    self._backend_settings.package,
                    self._backend_settings.profile_ignore_list)

        # Set the debug app if needed.
        self.platform_backend.SetDebugApp(self._backend_settings.package)