Example #1
0
 def GlobalSetUp(self):
     os.putenv('TEST_HTTP_PORT', str(ANDROID_TEST_HTTP_PORT))
     os.putenv('TEST_HTTPS_PORT', str(ANDROID_TEST_HTTPS_PORT))
     self._adb = android_commands.AndroidCommands()
     self._forwarder = forwarder.Forwarder(self._adb, 'Debug')
     self._forwarder.Run(
         [(ANDROID_TEST_HTTP_PORT, ANDROID_TEST_HTTP_PORT),
          (ANDROID_TEST_HTTPS_PORT, ANDROID_TEST_HTTPS_PORT)],
         valgrind_tools.BaseTool(), '127.0.0.1')
Example #2
0
 def GlobalSetUp():
   ChromeDriverTest._http_server = webserver.WebServer(
       chrome_paths.GetTestData())
   if _ANDROID_PACKAGE:
     ChromeDriverTest._adb = android_commands.AndroidCommands()
     ChromeDriverTest._forwarder = forwarder.Forwarder(ChromeDriverTest._adb,
                                                       'Debug')
     host_port = ChromeDriverTest._http_server._server.server_port
     ChromeDriverTest._forwarder.Run(
         [(host_port, host_port)], valgrind_tools.BaseTool(), '127.0.0.1')
Example #3
0
  def __init__(self, adb, *ports):
    assert HasForwarder(adb)

    port_pairs = [(port, port) for port in ports]
    tool = valgrind_tools.BaseTool()

    self._host_port = ports[0]
    buildtype = 'Debug'
    if HasForwarder(adb, 'Release'):
      buildtype = 'Release'
    self._forwarder = forwarder.Forwarder(
        adb.Adb(), port_pairs,
        tool, '127.0.0.1', buildtype)
Example #4
0
  def __init__(self, adb, *port_pairs):
    assert HasForwarder()
    tool = valgrind_tools.BaseTool()
    self._host_port = port_pairs[0].local_port

    new_port_pairs = [(port_pair.local_port, port_pair.remote_port)
                      for port_pair in port_pairs]

    buildtype = 'Debug'
    if HasForwarder('Release'):
      buildtype = 'Release'
    self._forwarder = forwarder.Forwarder(adb.Adb(), buildtype)
    self._forwarder.Run(new_port_pairs, tool, '127.0.0.1')
    def __init__(self, adb, host_port):
        assert HasForwarder(adb)

        port_pairs = [
            (host_port, host_port),
        ]
        tool = valgrind_tools.BaseTool()

        self._host_port = host_port
        buildtype = 'Debug'
        if HasForwarder(adb, 'Release'):
            buildtype = 'Release'
        self._forwarder = forwarder.Forwarder(adb.Adb(), port_pairs, tool,
                                              '127.0.0.1', buildtype)
        self._device_port = self._forwarder.DevicePortForHostPort(
            self._host_port)
Example #6
0
    def __init__(self, adb, *port_pairs):
        assert HasForwarder()
        tool = valgrind_tools.BaseTool()
        self._host_port = port_pairs[0][0]

        new_port_pairs = []
        for port_pair in port_pairs:
            if port_pair[1] is None:
                new_port_pairs.append((port_pair[0], port_pair[0]))
            else:
                new_port_pairs.append(port_pair)

        buildtype = 'Debug'
        if HasForwarder('Release'):
            buildtype = 'Release'
        self._forwarder = forwarder.Forwarder(adb.Adb(), buildtype)
        self._forwarder.Run(new_port_pairs, tool, '127.0.0.1')
Example #7
0
 def GlobalTearDown(self):
     if self._adb is not None:
         forwarder.Forwarder.KillDevice(self._adb,
                                        valgrind_tools.BaseTool())
     if self._forwarder is not None:
         self._forwarder.Close()
Example #8
0
 def GlobalTearDown():
   if _ANDROID_PACKAGE:
     forwarder.Forwarder.KillDevice(ChromeDriverTest._adb,
                                    valgrind_tools.BaseTool())
     ChromeDriverTest._forwarder.Close()
   ChromeDriverTest._http_server.Shutdown()