title: Error running tests on protractor (unknown error: updateWindow is not defined)
body: <p>I'm using Protractor for running the tests. It fails in random order and not always, but 5 times from 6 it fails with similar stacktrace. Can somebody, please, help to understand this feature and find the place where problem starts, to have possibility to look and maybe to fix?
  Here is a stacktrace:</p>
  
  <pre>
  [FAILED]
  UnknownError: unknown error: updateWindow is not defined
  JavaScript stack:
  ReferenceError: updateWindow is not defined
  at eval (eval at executeAsyncScript (unknown source), :2:9)
  at executeAsyncScript (:314:26)
  at apply.state (:330:29)
  at callFunction (:222:33)
  at apply.state (:232:23)
  at :233:3 at Object.InjectedScript.evaluateOn (:904:140)
  at Object.InjectedScript._evaluateAndWrap (:837:34)
  at Object.InjectedScript.evaluate (:693:21)
  (Session info: chrome=45.0.2454.85)
  (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64)
  (WARNING: The server did not provide any stacktrace information)
  Command duration or timeout: 667 milliseconds
  Driver info: org.openqa.selenium.chrome.ChromeDriver
  Capabilities [{platform=WIN8, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=scoped_dir7276_31813}, rotatable=false, locationContextEnabled=true, version=45.0.2454.85, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScreenshot=true}]
  at new bot.Error (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113:18)
  at Object.bot.response.checkResponse (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
  at npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:377:20
  at [object Object].promise.ControlFlow.runInFrame (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1877:20)
  at [object Object].promise.Callback_.goog.defineClass.notify (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:2464:25)
  at [object Object].promise.Promise.notify_ (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:563:12)
  at Array.forEach (native)
  at Object.goog.array.forEach (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\array\array.js:203:43)
  at [object Object].promise.Promise.notifyAll_ (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:552:16)
  at goog.async.run.processWorkQueue (npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:125:21)
  From: Task: Asynchronous test function: it()
  at [object Object]. (npm\node_modules\protractor\node_modules\jasminewd\index.js:93:33)
  at [object Object]. (npm\node_modules\protractor\node_modules\minijasminenode\lib\async-callback.js:45:37)
  at [object Object].jasmine.Block.execute (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:1174:17)
  at [object Object].jasmine.Queue.next_ (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2209:31)
  at [object Object].onTimeout (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:2199:18)
  at Timer.listOnTimeout (timers.js:119:15)
  ==== async task ==== Error
  at [object Object]. (loginSpec.js:3:5)
  at [object Object].jasmine.Env.describe (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:913:21)
  at [object Object].jasmine.Env.describe (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:898:15)
  at describe (npm\node_modules\protractor\node_modules\minijasminenode\lib\jasmine-1.3.1.js:658:27)
  at Object. (loginSpec.js:1:63)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  </pre>