lightbody/browsermob-proxy — pull request #54 by andyclark (2013-12-24 21:29:37+00:00)
Title: Get Selenium Proxy tests working

I've been working on a fix for the tests that were failing in issue #49

The main issue was that Selenium was getting 0.0.0.0 as the address for the browser to use to contact the proxy. On Windows at least, that's unreachable and so fails. This is because we're using ``ProxyServer.getLocalHost()`` as both the socket bind address, and as the proxy contact address for Selenium.

This pull request creates a new method on ``ProxyServer`` that returns a contact address. It looks for a local address of 0.0.0.0 and reverts to the old behaviour of returning ``InetAddress.getLocalHost()`` as a contactable address if found. ``ProxyServer.seleniumProxy()`` has been updated to use this new method.

As I didn't have Firefox or PhantomJS on my system, there's a few other changes that I made to auto-fetch PhantomJS for testing, and I have updated the Selenium bindings to 2.39.0 so they work with the latest version of Firefox.

Finally, I cleaned up the PhantomJS tests a little so they worked for me in the UK, and cleaned up proxies / drivers if tests failed.

So, with a bit of luck, this fixes #49.

There's still one test failing for me: ``testRequestAndResponseSizesAreSet(net.lightbody.bmp.proxy.HarResultsTest)`` - probably because I'm on windows and the ``Server`` header has some OS-specific banter in it.