tests for devtools integration with network requests/responses

This commit is contained in:
Prabhjyot Singh Sodhi 2015-09-01 22:55:57 +05:30
parent e04c2c78ee
commit 920bb5e4b8
8 changed files with 136 additions and 23 deletions

View file

@ -335,9 +335,9 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
let actor = actors.find_mut::<NetworkEventActor>(&netevent_actor_name);
match network_event {
NetworkEvent::HttpRequest(url, method, headers, body) => {
NetworkEvent::HttpRequest(httprequest) => {
//Store the request information in the actor
actor.add_request(url, method, headers, body);
actor.add_request(httprequest);
//Send a networkEvent message to the client
let msg = NetworkEventMsg {
@ -349,9 +349,9 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
stream.write_json_packet(&msg);
}
}
NetworkEvent::HttpResponse(headers, status, body) => {
NetworkEvent::HttpResponse(httpresponse) => {
//Store the response information in the actor
actor.add_response(headers, status, body);
actor.add_response(httpresponse);
//Send a networkEventUpdate (responseStart) to the client
let msg = NetworkEventUpdateMsg {