mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
test(net): update test cases
This commit is contained in:
parent
f69b124444
commit
c4c0d263e9
4 changed files with 23 additions and 27 deletions
|
@ -8,7 +8,9 @@ use net::test::parse_hostsfile;
|
|||
use net_traits::CoreResourceMsg;
|
||||
use profile_traits::mem::ProfilerChan as MemProfilerChan;
|
||||
use profile_traits::time::ProfilerChan;
|
||||
use script_traits::ConstellationMsg;
|
||||
use std::net::IpAddr;
|
||||
use std::sync::mpsc::channel;
|
||||
|
||||
fn ip(s: &str) -> IpAddr {
|
||||
s.parse().unwrap()
|
||||
|
@ -18,9 +20,12 @@ fn ip(s: &str) -> IpAddr {
|
|||
fn test_exit() {
|
||||
let (tx, _rx) = ipc::channel().unwrap();
|
||||
let (mtx, _mrx) = ipc::channel().unwrap();
|
||||
let (constellation, _) = channel();
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
let (resource_thread, _private_resource_thread) = new_core_resource_thread(
|
||||
let (resource_thread, _private_resource_thread, constellation_sender) = new_core_resource_thread(
|
||||
"".into(), None, ProfilerChan(tx), MemProfilerChan(mtx), None);
|
||||
constellation_sender.send(constellation.clone()).unwrap();
|
||||
let _ = constellation.send(ConstellationMsg::Exit);
|
||||
resource_thread.send(CoreResourceMsg::Exit(sender)).unwrap();
|
||||
receiver.recv().unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue