mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Start switching net/ to use abstractions over channels to allow introducing non-channel communication in the future.
This commit is contained in:
parent
7fddf4aa13
commit
1644436557
13 changed files with 108 additions and 79 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
extern crate hyper;
|
||||
|
||||
use net_traits::ResponseSenders::Channel;
|
||||
use net_traits::LoadData;
|
||||
use net_traits::ProgressMsg::{Payload, Done};
|
||||
use self::hyper::header::ContentType;
|
||||
|
@ -19,7 +20,7 @@ fn assert_parse(url: &'static str,
|
|||
use net::data_loader::load;
|
||||
|
||||
let (start_chan, start_port) = channel();
|
||||
load(LoadData::new(Url::parse(url).unwrap(), start_chan));
|
||||
load(LoadData::new(Url::parse(url).unwrap()), Channel(start_chan));
|
||||
|
||||
let response = start_port.recv().unwrap();
|
||||
assert_eq!(&response.metadata.content_type, &content_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue