mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Format remaining files
This commit is contained in:
parent
bf47f90da6
commit
cb07debcb6
252 changed files with 5944 additions and 3744 deletions
|
@ -6,29 +6,57 @@ use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
|
|||
|
||||
#[test]
|
||||
fn same_origin() {
|
||||
let a = MutableOrigin::new(ServoUrl::parse("http://example.com/a.html").unwrap().origin());
|
||||
let b = MutableOrigin::new(ServoUrl::parse("http://example.com/b.html").unwrap().origin());
|
||||
let a = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/a.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let b = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/b.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
assert!(a.same_origin(&b));
|
||||
assert_eq!(a.is_tuple(), true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn identical_origin() {
|
||||
let a = MutableOrigin::new(ServoUrl::parse("http://example.com/a.html").unwrap().origin());
|
||||
let a = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/a.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
assert!(a.same_origin(&a));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cross_origin() {
|
||||
let a = MutableOrigin::new(ServoUrl::parse("http://example.com/a.html").unwrap().origin());
|
||||
let b = MutableOrigin::new(ServoUrl::parse("http://example.org/b.html").unwrap().origin());
|
||||
let a = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/a.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let b = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.org/b.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
assert!(!a.same_origin(&b));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn clone_same_origin() {
|
||||
let a = MutableOrigin::new(ServoUrl::parse("http://example.com/a.html").unwrap().origin());
|
||||
let b = MutableOrigin::new(ServoUrl::parse("http://example.com/b.html").unwrap().origin());
|
||||
let a = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/a.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let b = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/b.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let c = b.clone();
|
||||
assert!(a.same_origin(&c));
|
||||
assert!(b.same_origin(&b));
|
||||
|
@ -38,8 +66,16 @@ fn clone_same_origin() {
|
|||
|
||||
#[test]
|
||||
fn clone_cross_origin() {
|
||||
let a = MutableOrigin::new(ServoUrl::parse("http://example.com/a.html").unwrap().origin());
|
||||
let b = MutableOrigin::new(ServoUrl::parse("http://example.org/b.html").unwrap().origin());
|
||||
let a = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.com/a.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let b = MutableOrigin::new(
|
||||
ServoUrl::parse("http://example.org/b.html")
|
||||
.unwrap()
|
||||
.origin(),
|
||||
);
|
||||
let c = b.clone();
|
||||
assert!(!a.same_origin(&c));
|
||||
assert!(b.same_origin(&c));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue