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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use fetch_sync;
use fetch;
use hyper::header::ContentType;
use hyper::mime::{Attr, Mime, SubLevel, TopLevel, Value};
use hyper_serde::Serde;
@ -21,7 +21,7 @@ fn assert_parse(url: &'static str,
let origin = Origin::Origin(url.origin());
let request = Request::new(url, Some(origin), false, None);
let response = fetch_sync(request, None);
let response = fetch(request, None);
match data {
Some(data) => {