Use the asynchronous fetching code in unit tests.

This is the only code that is used in Servo proper, so it's a more useful
thing to test.
This commit is contained in:
Ms2ger 2016-12-05 11:38:37 -10:00
parent c03cd45258
commit a5efc01b5f
4 changed files with 40 additions and 44 deletions

View file

@ -82,10 +82,6 @@ fn fetch(request: Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Response {
receiver.recv().unwrap()
}
fn fetch_sync(request: Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Response {
fetch_with_context(request, &new_fetch_context(dc))
}
fn fetch_with_context(request: Request, context: &FetchContext) -> Response {
methods::fetch(Rc::new(request), &mut None, context)
}