crawljax/crawljax — pull request #183 by alecgdouglas (2013-03-25 01:27:03+00:00)
Title: Chrome proxy fix (minor)

This is pull request simply fixes a bug that I noticed while investigating the source code for my group's project in EECE 310.

Previously: When a crawler is created and run with the Chrome browser config, the proxy settings are checked (in WebDriverBrowserBuilder) and if they aren't null then the proxy settings are passed into the Chrome driver as arguments.

However, if the crawler is created without specifying proxy settings, the default proxy settings are created with type "NOTHING" - with an invalid hostname (empty string?) and port (-1). Then later on they get past the null check, so the invalid proxy settings get passed into the Chrome driver and make the browser unable to connect to any websites.

To fix this, I changed it such that the proxy settings are checked for being null or having type "NOTHING".

Everything else in this commit is for testing this. Without the fix described above, the simple test included in this commit ("ChromeProxyConfig ") fails. The ChromeProxyConfig test uses a simple extension of the BaseCrawler that allows the browser config to be specified ("BrowserConfigCrawler"). Alternatively, BaseCrawler could be modified to allow the browser config to be specified, but I wasn't sure if I modify it or extend it.

I also fixed a small typo in one of the method names
(newCrawlConfiguartionBuilder -> newCrawlConfigurationBuilder)