diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2017-11-17 14:57:07 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2017-11-20 16:54:24 -0800 |
commit | 6dd7af2bdaa45f1f6fa70447f832db90a4aa35e2 (patch) | |
tree | 3c79d64c441ebcd1bb365844c98cf72fb8f3060d /tests/unit/net/lib.rs | |
parent | 27457e4d84f6f3ef05dc9f7ee3f84fa82e0de9da (diff) | |
download | servo-6dd7af2bdaa45f1f6fa70447f832db90a4aa35e2.tar.gz servo-6dd7af2bdaa45f1f6fa70447f832db90a4aa35e2.zip |
Fetch cancellation: Add CancellationListener
Diffstat (limited to 'tests/unit/net/lib.rs')
-rw-r--r-- | tests/unit/net/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/net/lib.rs b/tests/unit/net/lib.rs index bb5aed81fb3..497db8f6b30 100644 --- a/tests/unit/net/lib.rs +++ b/tests/unit/net/lib.rs @@ -36,7 +36,7 @@ use devtools_traits::DevtoolsControlMsg; use hyper::server::{Handler, Listening, Server}; use net::connector::create_ssl_client; use net::fetch::cors_cache::CorsCache; -use net::fetch::methods::{self, FetchContext}; +use net::fetch::methods::{self, CancellationListener, FetchContext}; use net::filemanager_thread::FileManager; use net::test::HttpState; use net_traits::FetchTaskTarget; @@ -44,7 +44,7 @@ use net_traits::request::Request; use net_traits::response::Response; use servo_config::resource_files::resources_dir_path; use servo_url::ServoUrl; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; use std::sync::mpsc::{Sender, channel}; const DEFAULT_USER_AGENT: &'static str = "Such Browser. Very Layout. Wow."; @@ -61,7 +61,7 @@ fn new_fetch_context(dc: Option<Sender<DevtoolsControlMsg>>) -> FetchContext { user_agent: DEFAULT_USER_AGENT.into(), devtools_chan: dc, filemanager: FileManager::new(), - cancel_chan: None, + cancellation_listener: Arc::new(Mutex::new(CancellationListener::new(None))), } } impl FetchTaskTarget for FetchResponseCollector { |