 ChromedriverPath = path.resolve(__dirname, '..', '..', '..', 'atom-shell', 'chromedriver', 'chromedriver')
 SocketPath = path.join(temp.mkdirSync("socket-dir"), "atom-#{process.env.USER}.sock")
 ChromedriverPort = 9515
+ChromedriverURLBase = "/wd/hub"
+ChromedriverStatusURL = "http://localhost:#{ChromedriverPort}#{ChromedriverURLBase}/status"
+
+pollChromeDriver = (done) ->
+  http.get(ChromedriverStatusURL, (response) ->
+    if response.statusCode is 200
+      done()
+    else
+      pollChromeDriver(done)
+  )
 
 buildAtomClient = (args, env) ->
   client = webdriverio.remote(

    chromedriver = spawn(ChromedriverPath, [
      "--verbose",
      "--port=#{ChromedriverPort}",
      "--url-base=/wd/hub"
    ])

    chromedriverLogs = []

path = require "path"
http = require "http"
temp = require("temp").track()
remote = require "remote"
async = require "async"
