Move the test_fetch_data test.

There is no longer any point in keeping it apart from the other data URL tests.
This commit is contained in:
Ms2ger 2016-11-03 11:33:52 +01:00
parent f304151fe2
commit bb9b0b3467
2 changed files with 9 additions and 25 deletions

View file

@ -77,6 +77,15 @@ fn plain_ct() {
Some(b"hello"));
}
#[test]
fn plain_html() {
assert_parse(
"data:text/html,<p>Servo</p>",
Some(ContentType(Mime(TopLevel::Text, SubLevel::Html, vec!()))),
None,
Some(b"<p>Servo</p>"));
}
#[test]
fn plain_charset() {
assert_parse(

View file

@ -103,31 +103,6 @@ fn test_fetch_aboutblank() {
assert!(*fetch_response.body.lock().unwrap() == ResponseBody::Done(vec![]));
}
#[test]
fn test_fetch_data() {
let url = Url::parse("data:text/html,<p>Servo</p>").unwrap();
let origin = Origin::Origin(url.origin());
let request = Request::new(url, Some(origin), false, None);
let expected_resp_body = "<p>Servo</p>".to_owned();
let fetch_response = fetch_sync(request, None);
assert!(!fetch_response.is_network_error());
assert_eq!(fetch_response.headers.len(), 1);
let content_type: &ContentType = fetch_response.headers.get().unwrap();
assert!(**content_type == Mime(TopLevel::Text, SubLevel::Html, vec![]));
let resp_body = fetch_response.body.lock().unwrap();
match *resp_body {
ResponseBody::Done(ref val) => {
assert_eq!(val, &expected_resp_body.into_bytes());
}
ResponseBody::Receiving(_) => {
panic!();
},
ResponseBody::Empty => panic!(),
}
}
#[test]
fn test_fetch_blob() {
use ipc_channel::ipc;