Pass a borrowed fetch context to fetch().

This will allow inspecting its state after fetching in unit tests.
This commit is contained in:
Ms2ger 2016-11-08 18:01:23 +01:00
parent 1153ca9841
commit 234b47e33e
4 changed files with 8 additions and 8 deletions

View file

@ -74,12 +74,12 @@ impl FetchTaskTarget for FetchResponseCollector {
fn fetch_async(request: Request, target: Box<FetchTaskTarget + Send>, dc: Option<Sender<DevtoolsControlMsg>>) {
thread::spawn(move || {
fetch(Rc::new(request), &mut Some(target), new_fetch_context(dc));
fetch(Rc::new(request), &mut Some(target), &new_fetch_context(dc));
});
}
fn fetch_sync(request: Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Response {
fetch(Rc::new(request), &mut None, new_fetch_context(dc))
fetch(Rc::new(request), &mut None, &new_fetch_context(dc))
}
fn make_server<H: Handler + 'static>(handler: H) -> (Listening, Url) {