mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there is no way to to create an aribitrary one without going through the parser. The plugin never had a clear demonstrated performance benefit, it was made mostly because it was possible and relatively easy at the time.
This commit is contained in:
parent
87d5424d4d
commit
6889f37d9e
27 changed files with 84 additions and 296 deletions
|
@ -7,6 +7,7 @@ extern crate cookie as cookie_rs;
|
|||
use net::cookie::Cookie;
|
||||
use net::cookie_storage::CookieStorage;
|
||||
use net_traits::CookieSource;
|
||||
use url::Url;
|
||||
|
||||
#[test]
|
||||
fn test_domain_match() {
|
||||
|
@ -56,9 +57,9 @@ fn test_default_path() {
|
|||
fn fn_cookie_constructor() {
|
||||
use net_traits::CookieSource;
|
||||
|
||||
let url = &url!("http://example.com/foo");
|
||||
let url = &Url::parse("http://example.com/foo").unwrap();
|
||||
|
||||
let gov_url = &url!("http://gov.ac/foo");
|
||||
let gov_url = &Url::parse("http://gov.ac/foo").unwrap();
|
||||
// cookie name/value test
|
||||
assert!(cookie_rs::Cookie::parse(" baz ").is_err());
|
||||
assert!(cookie_rs::Cookie::parse(" = bar ").is_err());
|
||||
|
@ -94,7 +95,7 @@ fn fn_cookie_constructor() {
|
|||
assert!(&cookie.cookie.domain.as_ref().unwrap()[..] == "example.com");
|
||||
assert!(cookie.host_only);
|
||||
|
||||
let u = &url!("http://example.com/foobar");
|
||||
let u = &Url::parse("http://example.com/foobar").unwrap();
|
||||
let cookie = cookie_rs::Cookie::parse("foobar=value;path=/").unwrap();
|
||||
assert!(Cookie::new_wrapped(cookie, u, CookieSource::HTTP).is_some());
|
||||
}
|
||||
|
@ -117,7 +118,7 @@ fn delay_to_ensure_different_timestamp() {
|
|||
fn test_sort_order() {
|
||||
use std::cmp::Ordering;
|
||||
|
||||
let url = &url!("http://example.com/foo");
|
||||
let url = &Url::parse("http://example.com/foo").unwrap();
|
||||
let a_wrapped = cookie_rs::Cookie::parse("baz=bar; Path=/foo/bar/").unwrap();
|
||||
let a = Cookie::new_wrapped(a_wrapped.clone(), url, CookieSource::HTTP).unwrap();
|
||||
delay_to_ensure_different_timestamp();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue