Merge branch 'master' into qa

* master:
  pass behavior_parameters from job configuration into Site objects
  add --behavior-parameters argument to brozzler-new-site
  fix bug in final_bounces (not sure what I was thinking)
  restore accidentally removed functionality handling page redirects and friends
  cat logs on travis-ci failure
  reppy 0.4.1 has a significantly different api apparently, so for now let's go back to 0.3.4
  still trying to get installation of pip to work on travis-ci
  update for reppy api change and pin to current version of reppy
  tweaks to ansible config to try to get the deployment to run on travis-ci
This commit is contained in:
Noah Levitt 2016-11-09 13:43:24 -08:00
commit 0eb07c9ca2
9 changed files with 73 additions and 39 deletions

View file

@ -344,8 +344,6 @@ __brzl_compileOutlinks(window).join(' ');
def callback(message):
if timer:
timer.cancel()
if message["id"] in self._waiting_on_result_messages:
del self._waiting_on_result_messages[message["id"]]
if "callback" in chain[0]:
chain[0]["callback"](message)
self._chain_chrome_messages(chain[1:])
@ -506,12 +504,19 @@ __brzl_compileOutlinks(window).join(' ');
self.on_response(message)
def _page_load_event_fired(self, message):
def page_url_after_load_event(message):
if message["result"]["result"]["value"] != self.url:
if self.on_url_change:
self.on_url_change(message["result"]["result"]["value"])
msg_id = self.send_to_chrome(
method="Runtime.evaluate",
params={"expression":"document.URL"})
self._waiting_on_result_messages[msg_id] = page_url_after_load_event
self.logger.info("Page.loadEventFired, moving on to starting behaviors url={}".format(self.url))
self._behavior = Behavior(self.url, self)
self._behavior.start(self.behavior_parameters)
self._waiting_on_document_url_msg_id = self.send_to_chrome(method="Runtime.evaluate", params={"expression":"document.URL"})
def _console_message_added(self, message):
self.logger.debug("%s console.%s %s", self._websock.url,
message["params"]["message"]["level"],
@ -553,6 +558,7 @@ __brzl_compileOutlinks(window).join(' ');
elif "result" in message:
if message["id"] in self._waiting_on_result_messages:
callback = self._waiting_on_result_messages[message["id"]]
del self._waiting_on_result_messages[message["id"]]
self.logger.debug(
"received result for message id=%s, calling %s",
message["id"], callback)