diff options
Diffstat (limited to 'tests')
32 files changed, 1125 insertions, 67 deletions
diff --git a/tests/ref/absolute_table.html b/tests/ref/absolute_table.html new file mode 100644 index 00000000000..b0dc978e34f --- /dev/null +++ b/tests/ref/absolute_table.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<style> +div { display:table;position:absolute;top:0px;right:40px } +</style> +<div> +XXX +</div> diff --git a/tests/ref/absolute_table_ref.html b/tests/ref/absolute_table_ref.html new file mode 100644 index 00000000000..40018562574 --- /dev/null +++ b/tests/ref/absolute_table_ref.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<style> +div { display:block;position:absolute;top:0px;right:40px } +</style> +<div> +XXX +</div> diff --git a/tests/ref/basic.list b/tests/ref/basic.list index ed4e0d91a4b..59d0934faae 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -12,6 +12,7 @@ fragment=top != ../html/acid2.html acid2_ref.html == abs_rel_explicit_height.html abs_rel_explicit_height_ref.html == absolute_hypothetical_with_intervening_inline_block_a.html absolute_hypothetical_with_intervening_inline_block_ref.html == absolute_inline_containing_block_a.html absolute_inline_containing_block_ref.html +== absolute_table.html absolute_table_ref.html == absolute_z_index_auto_paint_order_a.html absolute_z_index_auto_paint_order_ref.html == acid1_a.html acid1_b.html == acid2_noscroll.html acid2_ref_broken.html @@ -61,6 +62,7 @@ flaky_cpu == append_style_a.html append_style_b.html == border_code_tag.html border_code_tag_ref.html == border_collapse_missing_cell_a.html border_collapse_missing_cell_ref.html == border_collapse_simple_a.html border_collapse_simple_ref.html +== border_radius_asymmetric_sizes_a.html border_radius_asymmetric_sizes_ref.html == border_radius_clip_a.html border_radius_clip_ref.html != border_radius_dashed_a.html border_radius_dashed_ref.html == border_radius_overlapping_a.html border_radius_overlapping_ref.html @@ -294,6 +296,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html == position_relative_painting_order_a.html position_relative_painting_order_ref.html == position_relative_stacking_context_a.html position_relative_stacking_context_ref.html == position_relative_top_percentage_a.html position_relative_top_percentage_b.html +== position_relative_vertical_percentage_overflow_a.html position_relative_vertical_percentage_overflow_ref.html == pre_ignorable_whitespace_a.html pre_ignorable_whitespace_ref.html == pre_with_tab.html pre_with_tab_ref.html == pseudo_element_a.html pseudo_element_b.html diff --git a/tests/ref/border_radius_asymmetric_sizes_a.html b/tests/ref/border_radius_asymmetric_sizes_a.html new file mode 100644 index 00000000000..94676b11941 --- /dev/null +++ b/tests/ref/border_radius_asymmetric_sizes_a.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<html> + <head> + <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> + <meta content="utf-8" http-equiv="encoding"> + <style type="text/css"> + div.box { + background: white; + border-width: 10px 10px 10px 10px; + border-color: yellow red green blue; + border-radius: 10px; + border-style: solid; + height: 190px; + width: 190px; + } + div.top { + border-top-width: 30px; + } + div.right { + border-right-width: 30px; + } + div.bottom { + border-bottom-width: 30px; + } + div.left { + border-left-width: 30px; + } + div.radius10px { + border-radius: 10px; + } + div.radius20px { + border-radius: 20px; + } + div.radius30px { + border-radius: 30px; + } + div.radius40px { + border-radius: 40px; + } + + #box2, #box4, #box6, #box8, #box10, #box12, #box14 { + width: 170px; + } + </style> + </head> + <body> + <h2>Border Radius - 10px</h2> + Box#1<div id="box1" class="box top"></div><br> + Box#2<div id="box2" class="box right"></div><br> + Box#3<div id="box3" class="box bottom"></div><br> + Box#4<div id="box4" class="box left"></div><br> + + <h2>Border Radius - 20px</h2> + Box#5<div id="box5" class="box top radius20px"></div><br> + Box#6<div id="box6" class="box right radius20px"></div><br> + Box#7<div id="box7" class="box bottom radius20px"></div><br> + Box#8<div id="box8" class="box left radius20px"></div><br> + + <h2>Border Radius - 30px</h2> + Box#9<div id="box9" class="box top radius30px"></div><br> + Box#10<div id="box10" class="box right radius30px"></div><br> + Box#11<div id="box11" class="box bottom radius30px"></div><br> + Box#12<div id="box12" class="box left radius30px"></div><br> + + <h2>Border Radius - 40px</h2> + Box#13<div id="box13" class="box top radius40px"></div><br> + Box#14<div id="box14" class="box right radius40px"></div><br> + Box#15<div id="box15" class="box bottom radius40px"></div><br> + Box#16<div id="box16" class="box left radius40px"></div><br> + </body> +</html> diff --git a/tests/ref/border_radius_asymmetric_sizes_ref.html b/tests/ref/border_radius_asymmetric_sizes_ref.html new file mode 100644 index 00000000000..4993ae6fd7d --- /dev/null +++ b/tests/ref/border_radius_asymmetric_sizes_ref.html @@ -0,0 +1,217 @@ +<!DOCTYPE html> +<html> + <head> + <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> + <meta content="utf-8" http-equiv="encoding"> + <style type="text/css"> + .box-top { + background: white; + width: 190px; + height: 0px; + margin: 0px; + border-style: solid; + border-color: yellow red green blue; + } + .box-middle { + background: white; + width: 190px; + height: 190px; + margin: 0px; + border-style: solid; + border-color: yellow red green blue; + } + .box-bottom { + background: white; + width: 190px; + height: 0px; + margin: 0px; + border-style: solid; + border-color: yellow red green blue; + } + .top-radius-10 { + border-top-left-radius: 10px; + border-top-right-radius: 10px; + } + .bottom-radius-10 { + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; + } + .top-radius-20 { + border-top-left-radius: 20px; + border-top-right-radius: 20px; + } + .bottom-radius-20 { + border-bottom-left-radius: 20px; + border-bottom-right-radius: 20px; + } + .top-radius-30 { + border-top-left-radius: 30px; + border-top-right-radius: 30px; + } + .bottom-radius-30 { + border-bottom-left-radius: 30px; + border-bottom-right-radius: 30px; + } + .top-radius-40 { + border-top-left-radius: 40px; + border-top-right-radius: 40px; + } + .bottom-radius-40 { + border-bottom-left-radius: 40px; + border-bottom-right-radius: 40px; + } + .box1-top { + border-top-width: 30px; + border-right-width: 10px; + border-bottom-width: 0px; + border-left-width: 10px; + } + .box1-middle { + border-width: 0px 10px 0px 10px; + } + .box1-bottom { + border-width: 0px 10px 10px 10px; + } + .box2-top { + width: 170px; + border-width: 10px 30px 0px 10px; + } + .box2-middle { + width: 170px; + border-width: 0px 30px 0px 10px; + } + .box2-bottom { + width: 170px; + border-width: 0px 30px 10px 10px; + } + .box3-top { + border-width: 10px 10px 0px 10px; + } + .box3-middle { + border-width: 0px 10px 0px 10px; + } + .box3-bottom { + border-top-width: 0px; + border-left-width: 10px; + border-right-width: 10px; + border-bottom-width: 30px; + } + .box4-top { + width: 170px; + border-width: 10px 10px 0px 30px; + } + .box4-middle { + width: 170px; + border-width: 0px 10px 0px 30px; + } + .box4-bottom { + width: 170px; + border-top-width: 0px; + border-left-width: 30px; + border-right-width: 10px; + border-bottom-width: 10px; + } + </style> + </head> + <body> + <h2>Border Radius - 10px</h2> + Box#1 + <div id="box1-top" class="box-top box1-top top-radius-10"></div> + <div id="box1-middle" class="box-middle box1-middle middle-radius-10"></div> + <div id="box1-bottom" class="box-bottom box1-bottom bottom-radius-10"></div> + <br> + + Box#2 + <div id="box2-top" class="box-top box2-top top-radius-10"></div> + <div id="box2-middle" class="box-middle box2-middle middle-radius-10"></div> + <div id="box2-bottom" class="box-bottom box2-bottom bottom-radius-10"></div> + <br> + + Box#3 + <div id="box3-top" class="box-top box3-top top-radius-10"></div> + <div id="box3-middle" class="box-middle box3-middle middle-radius-10"></div> + <div id="box3-bottom" class="box-bottom box3-bottom bottom-radius-10"></div> + <br> + + Box#4 + <div id="box4-top" class="box-top box4-top top-radius-10"></div> + <div id="box4-middle" class="box-middle box4-middle middle-radius-10"></div> + <div id="box4-bottom" class="box-bottom box4-bottom bottom-radius-10"></div> + <br> + + <h2>Border Radius - 20px</h2> + Box#5 + <div id="box5-top" class="box-top box1-top top-radius-20"></div> + <div id="box5-middle" class="box-middle box1-middle middle-radius-20"></div> + <div id="box5-bottom" class="box-bottom box1-bottom bottom-radius-20"></div> + <br> + + Box#6 + <div id="box6-top" class="box-top box2-top top-radius-20"></div> + <div id="box6-middle" class="box-middle box2-middle middle-radius-20"></div> + <div id="box6-bottom" class="box-bottom box2-bottom bottom-radius-20"></div> + <br> + + Box#7 + <div id="box7-top" class="box-top box3-top top-radius-20"></div> + <div id="box7-middle" class="box-middle box3-middle middle-radius-20"></div> + <div id="box7-bottom" class="box-bottom box3-bottom bottom-radius-20"></div> + <br> + + Box#8 + <div id="box8-top" class="box-top box4-top top-radius-20"></div> + <div id="box8-middle" class="box-middle box4-middle middle-radius-20"></div> + <div id="box8-bottom" class="box-bottom box4-bottom bottom-radius-20"></div> + <br> + + <h2>Border Radius - 30px</h2> + Box#9 + <div id="box9-top" class="box-top box1-top top-radius-30"></div> + <div id="box9-middle" class="box-middle box1-middle middle-radius-30"></div> + <div id="box9-bottom" class="box-bottom box1-bottom bottom-radius-30"></div> + <br> + + Box#10 + <div id="box10-top" class="box-top box2-top top-radius-30"></div> + <div id="box10-middle" class="box-middle box2-middle middle-radius-30"></div> + <div id="box10-bottom" class="box-bottom box2-bottom bottom-radius-30"></div> + <br> + + Box#11 + <div id="box11-top" class="box-top box3-top top-radius-30"></div> + <div id="box11-middle" class="box-middle box3-middle middle-radius-30"></div> + <div id="box11-bottom" class="box-bottom box3-bottom bottom-radius-30"></div> + <br> + + Box#12 + <div id="box12-top" class="box-top box4-top top-radius-30"></div> + <div id="box12-middle" class="box-middle box4-middle middle-radius-30"></div> + <div id="box12-bottom" class="box-bottom box4-bottom bottom-radius-30"></div> + <br> + + <h2>Border Radius - 40px</h2> + Box#13 + <div id="box13-top" class="box-top box1-top top-radius-40"></div> + <div id="box13-middle" class="box-middle box1-middle middle-radius-40"></div> + <div id="box13-bottom" class="box-bottom box1-bottom bottom-radius-40"></div> + <br> + + Box#14 + <div id="box14-top" class="box-top box2-top top-radius-40"></div> + <div id="box14-middle" class="box-middle box2-middle middle-radius-40"></div> + <div id="box14-bottom" class="box-bottom box2-bottom bottom-radius-40"></div> + <br> + + Box#15 + <div id="box15-top" class="box-top box3-top top-radius-40"></div> + <div id="box15-middle" class="box-middle box3-middle middle-radius-40"></div> + <div id="box15-bottom" class="box-bottom box3-bottom bottom-radius-40"></div> + <br> + + Box#16 + <div id="box16-top" class="box-top box4-top top-radius-40"></div> + <div id="box16-middle" class="box-middle box4-middle middle-radius-40"></div> + <div id="box16-bottom" class="box-bottom box4-bottom bottom-radius-40"></div> + <br> + </body> +</html> diff --git a/tests/ref/position_relative_vertical_percentage_overflow_a.html b/tests/ref/position_relative_vertical_percentage_overflow_a.html new file mode 100644 index 00000000000..ca9aae49050 --- /dev/null +++ b/tests/ref/position_relative_vertical_percentage_overflow_a.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<style> +body, html { + margin: 0; +} +#a { + display: block; + position: absolute; + top: 100px; + left: 100px; + width: 100px; + height: 100px; + transform: translateX(0px); /* force creation of stacking context */ +} +#b { + display: block; + position: relative; + top: -50%; + width: 100px; + height: 100px; + background: purple; +} +</style> +<div id=a><div id=b> + diff --git a/tests/ref/position_relative_vertical_percentage_overflow_ref.html b/tests/ref/position_relative_vertical_percentage_overflow_ref.html new file mode 100644 index 00000000000..32bdcb8ab59 --- /dev/null +++ b/tests/ref/position_relative_vertical_percentage_overflow_ref.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<style> +body, html { + margin: 0; +} +#a { + display: block; + position: absolute; + top: 50px; + left: 100px; + width: 100px; + height: 100px; + background: purple; +} +</style> +<div id=a> + diff --git a/tests/ref/webgl-context/tex_image_2d_simple.html b/tests/ref/webgl-context/tex_image_2d_simple.html index 9ba19e2e6dc..60ea4674530 100644 --- a/tests/ref/webgl-context/tex_image_2d_simple.html +++ b/tests/ref/webgl-context/tex_image_2d_simple.html @@ -10,6 +10,7 @@ </style> <canvas id="c" width="256" height="256"></canvas> <script id="vertex_shader" type="x-shader/x-vertex"> + precision mediump float; attribute vec2 a_texCoord; attribute vec2 a_position; varying vec2 v_texCoord; @@ -21,6 +22,7 @@ </script> <script id="fragment_shader" type="x-shader/x-fragment"> + precision mediump float; uniform sampler2D u_image; varying vec2 v_texCoord; void main() { diff --git a/tests/unit/net/Cargo.toml b/tests/unit/net/Cargo.toml index 62c72b975bc..fdd82f7fb6d 100644 --- a/tests/unit/net/Cargo.toml +++ b/tests/unit/net/Cargo.toml @@ -25,3 +25,4 @@ cookie = "0.1" hyper = "0.6" url = "0.2" time = "0.1" +flate2 = "0.2.0" diff --git a/tests/unit/net/http_loader.rs b/tests/unit/net/http_loader.rs new file mode 100644 index 00000000000..f007522b433 --- /dev/null +++ b/tests/unit/net/http_loader.rs @@ -0,0 +1,666 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use flate2::Compression; +use flate2::write::{GzEncoder, DeflateEncoder}; +use hyper::header::{Headers, Location, ContentLength}; +use hyper::http::RawStatus; +use hyper::method::Method; +use hyper::status::StatusCode; +use ipc_channel::ipc; +use net::http_loader::{load, LoadError, HttpRequestFactory, HttpRequest, HttpResponse}; +use net::resource_task::new_resource_task; +use net_traits::LoadData; +use net_traits::{ResourceTask, ControlMsg, CookieSource}; +use std::borrow::Cow; +use std::io::{self, Write, Read, Cursor}; +use url::Url; + +fn respond_with(body: Vec<u8>) -> MockResponse { + let mut headers = Headers::new(); + respond_with_headers(body, &mut headers) +} + +fn respond_with_headers(body: Vec<u8>, headers: &mut Headers) -> MockResponse { + headers.set(ContentLength(body.len() as u64)); + + MockResponse::new( + headers.clone(), + StatusCode::Ok, + RawStatus(200, Cow::Borrowed("Ok")), + body + ) +} + +fn read_response(reader: &mut Read) -> String { + let mut buf = vec![0; 1024]; + match reader.read(&mut buf) { + Ok(len) if len > 0 => { + unsafe { buf.set_len(len); } + String::from_utf8(buf).unwrap() + }, + Ok(_) => "".to_string(), + Err(e) => panic!("problem reading response {}", e) + } +} + +struct MockResponse { + h: Headers, + sc: StatusCode, + sr: RawStatus, + msg: Cursor<Vec<u8>> +} + +impl MockResponse { + fn new(h: Headers, sc: StatusCode, sr: RawStatus, msg: Vec<u8>) -> MockResponse { + MockResponse { h: h, sc: sc, sr: sr, msg: Cursor::new(msg) } + } +} + +impl Read for MockResponse { + fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { + self.msg.read(buf) + } +} + +impl HttpResponse for MockResponse { + fn headers(&self) -> &Headers { &self.h } + fn status(&self) -> StatusCode { self.sc } + fn status_raw(&self) -> &RawStatus { &self.sr } +} + +fn redirect_to(host: String) -> MockResponse { + let mut headers = Headers::new(); + headers.set(Location(host.to_string())); + + MockResponse::new( + headers, + StatusCode::MovedPermanently, + RawStatus(301, Cow::Borrowed("Moved Permanently")), + <[_]>::to_vec("".as_bytes()) + ) +} + + +enum ResponseType { + Redirect(String), + Text(Vec<u8>), + WithHeaders(Vec<u8>, Headers) +} + +struct MockRequest { + headers: Headers, + t: ResponseType +} + +impl MockRequest { + fn new(t: ResponseType) -> MockRequest { + MockRequest { headers: Headers::new(), t: t } + } +} + +fn response_for_request_type(t: ResponseType) -> Result<MockResponse, LoadError> { + match t { + ResponseType::Redirect(location) => { + Ok(redirect_to(location)) + }, + ResponseType::Text(b) => { + Ok(respond_with(b)) + }, + ResponseType::WithHeaders(b, mut h) => { + Ok(respond_with_headers(b, &mut h)) + } + } +} + +impl HttpRequest for MockRequest { + type R = MockResponse; + + fn headers_mut(&mut self) -> &mut Headers { &mut self.headers } + + fn send(self, _: &Option<Vec<u8>>) -> Result<MockResponse, LoadError> { + response_for_request_type(self.t) + } +} + +struct AssertRequestMustHaveHeaders { + expected_headers: Headers, + request_headers: Headers, + t: ResponseType +} + +impl AssertRequestMustHaveHeaders { + fn new(t: ResponseType, expected_headers: Headers) -> Self { + AssertRequestMustHaveHeaders { expected_headers: expected_headers, request_headers: Headers::new(), t: t } + } +} + +impl HttpRequest for AssertRequestMustHaveHeaders { + type R = MockResponse; + + fn headers_mut(&mut self) -> &mut Headers { &mut self.request_headers } + + fn send(self, _: &Option<Vec<u8>>) -> Result<MockResponse, LoadError> { + for header in self.expected_headers.iter() { + assert!(self.request_headers.get_raw(header.name()).is_some()); + assert_eq!( + self.request_headers.get_raw(header.name()).unwrap(), + self.expected_headers.get_raw(header.name()).unwrap() + ) + } + + response_for_request_type(self.t) + } +} + +struct AssertMustHaveHeadersRequestFactory { + expected_headers: Headers, + body: Vec<u8> +} + +impl HttpRequestFactory for AssertMustHaveHeadersRequestFactory { + type R = AssertRequestMustHaveHeaders; + + fn create(&self, _: Url, _: Method) -> Result<AssertRequestMustHaveHeaders, LoadError> { + Ok( + AssertRequestMustHaveHeaders::new( + ResponseType::Text(self.body.clone()), + self.expected_headers.clone() + ) + ) + } +} + +fn assert_cookie_for_domain(resource_mgr: &ResourceTask, domain: &str, cookie: &str) { + let (tx, rx) = ipc::channel().unwrap(); + resource_mgr.send(ControlMsg::GetCookiesForUrl(Url::parse(&*domain).unwrap(), + tx, + CookieSource::HTTP)).unwrap(); + if let Some(cookie_list) = rx.recv().unwrap() { + assert_eq!(cookie.to_string(), cookie_list); + } else { + assert_eq!(cookie.len(), 0); + } +} + +struct AssertMustHaveBodyRequest { + expected_body: Option<Vec<u8>>, + headers: Headers, + t: ResponseType +} + +impl AssertMustHaveBodyRequest { + fn new(t: ResponseType, expected_body: Option<Vec<u8>>) -> Self { + AssertMustHaveBodyRequest { expected_body: expected_body, headers: Headers::new(), t: t } + } +} + +impl HttpRequest for AssertMustHaveBodyRequest { + type R = MockResponse; + + fn headers_mut(&mut self) -> &mut Headers { &mut self.headers } + + fn send(self, body: &Option<Vec<u8>>) -> Result<MockResponse, LoadError> { + assert_eq!(self.expected_body, *body); + + response_for_request_type(self.t) + } +} + +#[test] +fn test_load_when_request_is_not_get_or_head_and_there_is_no_body_content_length_should_be_set_to_0() { + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = None; + load_data.method = Method::Post; + + let mut content_length = Headers::new(); + content_length.set_raw("Content-Length".to_owned(), vec![<[_]>::to_vec("0".as_bytes())]); + + let _ = load::<AssertRequestMustHaveHeaders>( + load_data.clone(), resource_mgr, None, + &AssertMustHaveHeadersRequestFactory { + expected_headers: content_length, + body: <[_]>::to_vec(&[]) + }); +} + +#[test] +fn test_load_when_redirecting_from_a_post_should_rewrite_next_request_as_get() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, url: Url, method: Method) -> Result<MockRequest, LoadError> { + if url.domain().unwrap() == "mozilla.com" { + assert_eq!(Method::Post, method); + Ok(MockRequest::new(ResponseType::Redirect("http://mozilla.org".to_string()))) + } else { + assert_eq!(Method::Get, method); + Ok(MockRequest::new(ResponseType::Text(<[_]>::to_vec("Yay!".as_bytes())))) + } + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.method = Method::Post; + + let _ = load::<MockRequest>(load_data, resource_mgr, None, &Factory); +} + +#[test] +fn test_load_should_decode_the_response_as_deflate_when_response_headers_have_content_encoding_deflate() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, _: Url, _: Method) -> Result<MockRequest, LoadError> { + let mut e = DeflateEncoder::new(Vec::new(), Compression::Default); + e.write(b"Yay!").unwrap(); + let encoded_content = e.finish().unwrap(); + + let mut headers = Headers::new(); + headers.set_raw("Content-Encoding", vec![b"deflate".to_vec()]); + Ok(MockRequest::new(ResponseType::WithHeaders(encoded_content, headers))) + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + let mut response = load::<MockRequest>(load_data, resource_mgr.clone(), None, &Factory).unwrap(); + + assert_eq!(read_response(&mut response), "Yay!"); +} + +#[test] +fn test_load_should_decode_the_response_as_gzip_when_response_headers_have_content_encoding_gzip() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, _: Url, _: Method) -> Result<MockRequest, LoadError> { + let mut e = GzEncoder::new(Vec::new(), Compression::Default); + e.write(b"Yay!").unwrap(); + let encoded_content = e.finish().unwrap(); + + let mut headers = Headers::new(); + headers.set_raw("Content-Encoding", vec![b"gzip".to_vec()]); + Ok(MockRequest::new(ResponseType::WithHeaders(encoded_content, headers))) + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + let mut response = load::<MockRequest>(load_data, resource_mgr.clone(), None, &Factory).unwrap(); + + assert_eq!(read_response(&mut response), "Yay!"); +} + +#[test] +fn test_load_doesnt_send_request_body_on_any_redirect() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = AssertMustHaveBodyRequest; + + fn create(&self, url: Url, _: Method) -> Result<AssertMustHaveBodyRequest, LoadError> { + if url.domain().unwrap() == "mozilla.com" { + Ok( + AssertMustHaveBodyRequest::new( + ResponseType::Redirect("http://mozilla.org".to_string()), + Some(<[_]>::to_vec("Body on POST!".as_bytes())) + ) + ) + } else { + Ok( + AssertMustHaveBodyRequest::new( + ResponseType::Text(<[_]>::to_vec("Yay!".as_bytes())), + None + ) + ) + } + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Body on POST!".as_bytes())); + + + let _ = load::<AssertMustHaveBodyRequest>(load_data, resource_mgr, None, &Factory); +} + +#[test] +fn test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_are_present() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, _: Url, _: Method) -> Result<MockRequest, LoadError> { + let content = <[_]>::to_vec("Yay!".as_bytes()); + let mut headers = Headers::new(); + headers.set_raw("Strict-Transport-Security", vec![b"max-age=31536000".to_vec()]); + Ok(MockRequest::new(ResponseType::WithHeaders(content, headers))) + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + + let load_data = LoadData::new(url.clone(), None); + + let _ = load::<MockRequest>(load_data, resource_mgr.clone(), None, &Factory); + + let (tx, rx) = ipc::channel().unwrap(); + resource_mgr.send(ControlMsg::GetHostMustBeSecured("mozilla.com".to_string(), tx)).unwrap(); + + assert_eq!(rx.recv().unwrap(), false); +} + +#[test] +fn test_load_adds_host_to_sts_list_when_url_is_https_and_sts_headers_are_present() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, _: Url, _: Method) -> Result<MockRequest, LoadError> { + let content = <[_]>::to_vec("Yay!".as_bytes()); + let mut headers = Headers::new(); + headers.set_raw("Strict-Transport-Security", vec![b"max-age=31536000".to_vec()]); + Ok(MockRequest::new(ResponseType::WithHeaders(content, headers))) + } + } + + let url = Url::parse("https://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + + let load_data = LoadData::new(url.clone(), None); + + let _ = load::<MockRequest>(load_data, resource_mgr.clone(), None, &Factory); + + let (tx, rx) = ipc::channel().unwrap(); + resource_mgr.send(ControlMsg::GetHostMustBeSecured("mozilla.com".to_string(), tx)).unwrap(); + + assert!(rx.recv().unwrap()); +} + +#[test] +fn test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_in_response() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, _: Url, _: Method) -> Result<MockRequest, LoadError> { + let content = <[_]>::to_vec("Yay!".as_bytes()); + let mut headers = Headers::new(); + headers.set_raw("set-cookie", vec![b"mozillaIs=theBest".to_vec()]); + Ok(MockRequest::new(ResponseType::WithHeaders(content, headers))) + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + assert_cookie_for_domain(&resource_mgr, "http://mozilla.com", ""); + + let load_data = LoadData::new(url.clone(), None); + + let _ = load::<MockRequest>(load_data, resource_mgr.clone(), None, &Factory); + + assert_cookie_for_domain(&resource_mgr, "http://mozilla.com", "mozillaIs=theBest"); +} + +#[test] +fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_resource_manager() { + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + resource_mgr.send(ControlMsg::SetCookiesForUrl(Url::parse("http://mozilla.com").unwrap(), + "mozillaIs=theBest".to_string(), + CookieSource::HTTP)).unwrap(); + + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Yay!".as_bytes())); + + let mut cookie = Headers::new(); + cookie.set_raw("Cookie".to_owned(), vec![<[_]>::to_vec("mozillaIs=theBest".as_bytes())]); + + let _ = load::<AssertRequestMustHaveHeaders>( + load_data.clone(), resource_mgr, None, + &AssertMustHaveHeadersRequestFactory { + expected_headers: cookie, + body: <[_]>::to_vec(&*load_data.data.unwrap()) + }); +} + +#[test] +fn test_load_sets_content_length_to_length_of_request_body() { + let content = "This is a request body"; + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec(content.as_bytes())); + + let mut content_len_headers = Headers::new(); + let content_len = format!("{}", content.len()); + content_len_headers.set_raw( + "Content-Length".to_owned(), vec![<[_]>::to_vec(&*content_len.as_bytes())] + ); + + let _ = load::<AssertRequestMustHaveHeaders>( + load_data.clone(), resource_mgr, None, + &AssertMustHaveHeadersRequestFactory { + expected_headers: content_len_headers, + body: <[_]>::to_vec(&*load_data.data.unwrap()) + }); +} + +#[test] +fn test_load_uses_explicit_accept_from_headers_in_load_data() { + let mut accept_headers = Headers::new(); + accept_headers.set_raw("Accept".to_owned(), vec![b"text/html".to_vec()]); + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Yay!".as_bytes())); + load_data.headers.set_raw("Accept".to_owned(), vec![b"text/html".to_vec()]); + + let _ = load::<AssertRequestMustHaveHeaders>(load_data, resource_mgr, None, &AssertMustHaveHeadersRequestFactory { + expected_headers: accept_headers, + body: <[_]>::to_vec("Yay!".as_bytes()) + }); +} + +#[test] +fn test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else() { + let mut accept_headers = Headers::new(); + accept_headers.set_raw( + "Accept".to_owned(), vec![b"text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8".to_vec()] + ); + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Yay!".as_bytes())); + + let _ = load::<AssertRequestMustHaveHeaders>(load_data, resource_mgr, None, &AssertMustHaveHeadersRequestFactory { + expected_headers: accept_headers, + body: <[_]>::to_vec("Yay!".as_bytes()) + }); +} + +#[test] +fn test_load_uses_explicit_accept_encoding_from_load_data_headers() { + let mut accept_encoding_headers = Headers::new(); + accept_encoding_headers.set_raw("Accept-Encoding".to_owned(), vec![b"chunked".to_vec()]); + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Yay!".as_bytes())); + load_data.headers.set_raw("Accept-Encoding".to_owned(), vec![b"chunked".to_vec()]); + + let _ = load::<AssertRequestMustHaveHeaders>(load_data, resource_mgr, None, &AssertMustHaveHeadersRequestFactory { + expected_headers: accept_encoding_headers, + body: <[_]>::to_vec("Yay!".as_bytes()) + }); +} + +#[test] +fn test_load_sets_default_accept_encoding_to_gzip_and_deflate() { + let mut accept_encoding_headers = Headers::new(); + accept_encoding_headers.set_raw("Accept-Encoding".to_owned(), vec![b"gzip, deflate".to_vec()]); + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let mut load_data = LoadData::new(url.clone(), None); + load_data.data = Some(<[_]>::to_vec("Yay!".as_bytes())); + + let _ = load::<AssertRequestMustHaveHeaders>(load_data, resource_mgr, None, &AssertMustHaveHeadersRequestFactory { + expected_headers: accept_encoding_headers, + body: <[_]>::to_vec("Yay!".as_bytes()) + }); +} + +#[test] +fn test_load_errors_when_there_a_redirect_loop() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, url: Url, _: Method) -> Result<MockRequest, LoadError> { + if url.domain().unwrap() == "mozilla.com" { + Ok(MockRequest::new(ResponseType::Redirect("http://mozilla.org".to_string()))) + } else if url.domain().unwrap() == "mozilla.org" { + Ok(MockRequest::new(ResponseType::Redirect("http://mozilla.com".to_string()))) + } else { + panic!("unexpected host {:?}", url) + } + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + + match load::<MockRequest>(load_data, resource_mgr, None, &Factory) { + Err(LoadError::InvalidRedirect(_, msg)) => { + assert_eq!(msg, "redirect loop"); + }, + _ => panic!("expected max redirects to fail") + } +} + +#[test] +fn test_load_errors_when_there_is_too_many_redirects() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, url: Url, _: Method) -> Result<MockRequest, LoadError> { + if url.domain().unwrap() == "mozilla.com" { + Ok(MockRequest::new(ResponseType::Redirect(format!("{}/1", url.serialize())))) + } else { + panic!("unexpected host {:?}", url) + } + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + + match load::<MockRequest>(load_data, resource_mgr, None, &Factory) { + Err(LoadError::MaxRedirects(url)) => { + assert_eq!(url.domain().unwrap(), "mozilla.com") + }, + _ => panic!("expected max redirects to fail") + } +} + +#[test] +fn test_load_follows_a_redirect() { + struct Factory; + + impl HttpRequestFactory for Factory { + type R = MockRequest; + + fn create(&self, url: Url, _: Method) -> Result<MockRequest, LoadError> { + if url.domain().unwrap() == "mozilla.com" { + Ok(MockRequest::new(ResponseType::Redirect("http://mozilla.org".to_string()))) + } else if url.domain().unwrap() == "mozilla.org" { + Ok( + MockRequest::new( + ResponseType::Text( + <[_]>::to_vec("Yay!".as_bytes()) + ) + ) + ) + } else { + panic!("unexpected host {:?}", url) + } + } + } + + let url = Url::parse("http://mozilla.com").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + + match load::<MockRequest>(load_data, resource_mgr, None, &Factory) { + Err(e) => panic!("expected to follow a redirect {:?}", e), + Ok(mut lr) => { + let response = read_response(&mut lr); + assert_eq!(response, "Yay!".to_string()); + } + } +} + +struct DontConnectFactory; + +impl HttpRequestFactory for DontConnectFactory { + type R = MockRequest; + + fn create(&self, url: Url, _: Method) -> Result<MockRequest, LoadError> { + Err(LoadError::Connection(url, "should not have connected".to_string())) + } +} + +#[test] +fn test_load_errors_when_scheme_is_not_http_or_https() { + let url = Url::parse("ftp://not-supported").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + + match load::<MockRequest>(load_data, resource_mgr, None, &DontConnectFactory) { + Err(LoadError::UnsupportedScheme(_)) => {} + _ => panic!("expected ftp scheme to be unsupported") + } +} + +#[test] +fn test_load_errors_when_viewing_source_and_inner_url_scheme_is_not_http_or_https() { + let url = Url::parse("view-source:ftp://not-supported").unwrap(); + let resource_mgr = new_resource_task("Test-agent".to_string(), None); + let load_data = LoadData::new(url.clone(), None); + + match load::<MockRequest>(load_data, resource_mgr, None, &DontConnectFactory) { + Err(LoadError::UnsupportedScheme(_)) => {} + _ => panic!("expected ftp scheme to be unsupported") + } +} diff --git a/tests/unit/net/lib.rs b/tests/unit/net/lib.rs index 3f737fc1783..8f7b0d1511f 100644 --- a/tests/unit/net/lib.rs +++ b/tests/unit/net/lib.rs @@ -10,9 +10,12 @@ extern crate net_traits; extern crate url; extern crate util; extern crate time; +extern crate hyper; +extern crate flate2; #[cfg(test)] mod cookie; #[cfg(test)] mod data_loader; #[cfg(test)] mod mime_classifier; #[cfg(test)] mod resource_task; #[cfg(test)] mod hsts; +#[cfg(test)] mod http_loader; diff --git a/tests/unit/net/mime_classifier.rs b/tests/unit/net/mime_classifier.rs index b2e48926901..2c62878872e 100644 --- a/tests/unit/net/mime_classifier.rs +++ b/tests/unit/net/mime_classifier.rs @@ -434,7 +434,14 @@ fn test_sniff_utf_8_bom() { #[test] fn test_sniff_rss_feed() { + // RSS feeds test_sniff_full(&PathBuf::from("text/xml/feed.rss"), "application", "rss+xml", Some(("text", "html"))); + test_sniff_full(&PathBuf::from("text/xml/rdf_rss.xml"), "application", "rss+xml", Some(("text", "html"))); + // Not RSS feeds + test_sniff_full(&PathBuf::from("text/xml/rdf_rss_ko_1.xml"), "text", "html", Some(("text", "html"))); + test_sniff_full(&PathBuf::from("text/xml/rdf_rss_ko_2.xml"), "text", "html", Some(("text", "html"))); + test_sniff_full(&PathBuf::from("text/xml/rdf_rss_ko_3.xml"), "text", "html", Some(("text", "html"))); + test_sniff_full(&PathBuf::from("text/xml/rdf_rss_ko_4.xml"), "text", "html", Some(("text", "html"))); } #[test] diff --git a/tests/unit/net/parsable_mime/text/xml/rdf_rss.xml b/tests/unit/net/parsable_mime/text/xml/rdf_rss.xml new file mode 100644 index 00000000000..4c58f82974e --- /dev/null +++ b/tests/unit/net/parsable_mime/text/xml/rdf_rss.xml @@ -0,0 +1,7 @@ +<!-- Good format for a "RDF feed" --> +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://purl.org/rss/1.0/" +> +</rdf:RDF>
\ No newline at end of file diff --git a/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_1.xml b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_1.xml new file mode 100644 index 00000000000..f6e486c5960 --- /dev/null +++ b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_1.xml @@ -0,0 +1,7 @@ +<!-- Bad format for a "RDF feed" (space between "rdf:" and "RDF") --> +<?xml version="1.0"?> +<rdf: RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://purl.org/rss/1.0/" +> +</rdf:RDF>
\ No newline at end of file diff --git a/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_2.xml b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_2.xml new file mode 100644 index 00000000000..be8414382e5 --- /dev/null +++ b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_2.xml @@ -0,0 +1,3 @@ +<!-- Bad format for a "RDF feed" (2 missing URLs) --> +<?xml version="1.0"?> +<rdf:RDF/>
\ No newline at end of file diff --git a/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_3.xml b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_3.xml new file mode 100644 index 00000000000..5f0f03f1e2d --- /dev/null +++ b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_3.xml @@ -0,0 +1,6 @@ +<!-- Bad format for a "RDF feed" (one missing URL) --> +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" +> +</rdf:RDF>
\ No newline at end of file diff --git a/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_4.xml b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_4.xml new file mode 100644 index 00000000000..c06a80cf1f8 --- /dev/null +++ b/tests/unit/net/parsable_mime/text/xml/rdf_rss_ko_4.xml @@ -0,0 +1,7 @@ +<!-- Bad format for a "RDF feed" (unexpected space in first URL) --> +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http: //www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://purl.org/rss/1.0/" +> +</rdf:RDF>
\ No newline at end of file diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 313ab62fe0a..74891b52cae 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -9,9 +9,9 @@ use msg::constellation_msg::{Key, KeyModifiers}; -#[cfg(target_os="macos")] +#[cfg(target_os = "macos")] use msg::constellation_msg::SUPER; -#[cfg(not(target_os="macos"))] +#[cfg(not(target_os = "macos"))] use msg::constellation_msg::CONTROL; use script::clipboard_provider::DummyClipboardContext; @@ -194,9 +194,9 @@ fn test_textinput_set_content() { #[test] fn test_clipboard_paste() { - #[cfg(target_os="macos")] + #[cfg(target_os = "macos")] const MODIFIERS: KeyModifiers = SUPER; - #[cfg(not(target_os="macos"))] + #[cfg(not(target_os = "macos"))] const MODIFIERS: KeyModifiers = CONTROL; let mut textinput = TextInput::new(Lines::Single, "defg".to_owned(), DummyClipboardContext::new("abc")); @@ -205,3 +205,57 @@ fn test_clipboard_paste() { textinput.handle_keydown_aux(Key::V, MODIFIERS); assert_eq!(textinput.get_content(), "abcdefg"); } + +#[test] +fn test_textinput_cursor_position_correct_after_clearing_selection() { + let mut textinput = TextInput::new(Lines::Single, "abcdef".to_owned(), DummyClipboardContext::new("")); + + // Single line - Forward + textinput.adjust_horizontal(3, Selection::Selected); + textinput.adjust_horizontal(1, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 3); + + textinput.adjust_horizontal(-3, Selection::NotSelected); + textinput.adjust_horizontal(3, Selection::Selected); + textinput.adjust_horizontal_by_one(Direction::Forward, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 3); + + // Single line - Backward + textinput.adjust_horizontal(-3, Selection::NotSelected); + textinput.adjust_horizontal(3, Selection::Selected); + textinput.adjust_horizontal(-1, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + + textinput.adjust_horizontal(-3, Selection::NotSelected); + textinput.adjust_horizontal(3, Selection::Selected); + textinput.adjust_horizontal_by_one(Direction::Backward, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + + + let mut textinput = TextInput::new(Lines::Multiple, "abc\nde\nf".to_owned(), DummyClipboardContext::new("")); + + // Multiline - Forward + textinput.adjust_horizontal(4, Selection::Selected); + textinput.adjust_horizontal(1, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + assert_eq!(textinput.edit_point.line, 1); + + textinput.adjust_horizontal(-4, Selection::NotSelected); + textinput.adjust_horizontal(4, Selection::Selected); + textinput.adjust_horizontal_by_one(Direction::Forward, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + assert_eq!(textinput.edit_point.line, 1); + + // Multiline - Backward + textinput.adjust_horizontal(-4, Selection::NotSelected); + textinput.adjust_horizontal(4, Selection::Selected); + textinput.adjust_horizontal(-1, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + assert_eq!(textinput.edit_point.line, 0); + + textinput.adjust_horizontal(-4, Selection::NotSelected); + textinput.adjust_horizontal(4, Selection::Selected); + textinput.adjust_horizontal_by_one(Direction::Backward, Selection::NotSelected); + assert_eq!(textinput.edit_point.index, 0); + assert_eq!(textinput.edit_point.line, 0); +} diff --git a/tests/wpt/include.ini b/tests/wpt/include.ini index cbd4f34dbf1..1c00f118a49 100644 --- a/tests/wpt/include.ini +++ b/tests/wpt/include.ini @@ -73,18 +73,6 @@ skip: true skip: false [workers] skip: false - [constructors] - skip: false - [SharedWorker] - skip: true - [semantics] - skip: false - [navigation] - skip: true - [reporting-errors] - skip: true - [structured-clone] - skip: true [XMLHttpRequest] skip: false [old-tests] diff --git a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-069.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-069.htm.ini deleted file mode 100644 index 3393052ea38..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-069.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[abs-pos-non-replaced-vlr-069.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-177.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-177.htm.ini deleted file mode 100644 index e1c3b4f4d05..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-177.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[abs-pos-non-replaced-vlr-177.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-193.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-193.htm.ini deleted file mode 100644 index 5e854311604..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vlr-193.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[abs-pos-non-replaced-vlr-193.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-176.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-176.htm.ini deleted file mode 100644 index eefff3cffd7..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-176.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[abs-pos-non-replaced-vrl-176.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-192.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-192.htm.ini deleted file mode 100644 index ae93a9937bd..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/abs-pos-non-replaced-vrl-192.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[abs-pos-non-replaced-vrl-192.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css21_dev/html4/absolute-replaced-width-015.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/absolute-replaced-width-015.htm.ini deleted file mode 100644 index d17e0d4951e..00000000000 --- a/tests/wpt/metadata-css/css21_dev/html4/absolute-replaced-width-015.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[absolute-replaced-width-015.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index cb01cd8f47d..080c6d4e7d5 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -8430,9 +8430,6 @@ [Worker interface: operation terminate()] expected: FAIL - [Worker interface: attribute onerror] - expected: FAIL - [SharedWorker interface: existence and properties of interface object] expected: FAIL diff --git a/tests/wpt/metadata/url/interfaces.html.ini b/tests/wpt/metadata/url/interfaces.html.ini index f1a85fdfc35..17a665ab572 100644 --- a/tests/wpt/metadata/url/interfaces.html.ini +++ b/tests/wpt/metadata/url/interfaces.html.ini @@ -3,42 +3,12 @@ [URL interface: operation domainToUnicode(ScalarValueString)] expected: FAIL - [URL interface: attribute href] - expected: FAIL - [URL interface: attribute origin] expected: FAIL - [URL interface: attribute protocol] - expected: FAIL - - [URL interface: attribute username] - expected: FAIL - - [URL interface: attribute password] - expected: FAIL - - [URL interface: attribute host] - expected: FAIL - - [URL interface: attribute hostname] - expected: FAIL - - [URL interface: attribute port] - expected: FAIL - - [URL interface: attribute pathname] - expected: FAIL - - [URL interface: attribute search] - expected: FAIL - [URL interface: attribute searchParams] expected: FAIL - [URL interface: attribute hash] - expected: FAIL - [URL interface: new URL("http://foo") must inherit property "origin" with the proper type (3)] expected: FAIL diff --git a/tests/wpt/metadata/workers/constructors/SharedWorker/__dir__.ini b/tests/wpt/metadata/workers/constructors/SharedWorker/__dir__.ini new file mode 100644 index 00000000000..168df4e0769 --- /dev/null +++ b/tests/wpt/metadata/workers/constructors/SharedWorker/__dir__.ini @@ -0,0 +1 @@ +disabled: SharedWorker diff --git a/tests/wpt/metadata/workers/semantics/navigation/001.html.ini b/tests/wpt/metadata/workers/semantics/navigation/001.html.ini new file mode 100644 index 00000000000..b3538369e2e --- /dev/null +++ b/tests/wpt/metadata/workers/semantics/navigation/001.html.ini @@ -0,0 +1,3 @@ +[001.html] + type: testharness + expected: TIMEOUT diff --git a/tests/wpt/metadata/workers/semantics/navigation/002.html.ini b/tests/wpt/metadata/workers/semantics/navigation/002.html.ini new file mode 100644 index 00000000000..23e8bb1452d --- /dev/null +++ b/tests/wpt/metadata/workers/semantics/navigation/002.html.ini @@ -0,0 +1,5 @@ +[002.html] + type: testharness + [navigating 2] + expected: FAIL + diff --git a/tests/wpt/metadata/workers/semantics/reporting-errors/__dir__.ini b/tests/wpt/metadata/workers/semantics/reporting-errors/__dir__.ini new file mode 100644 index 00000000000..168df4e0769 --- /dev/null +++ b/tests/wpt/metadata/workers/semantics/reporting-errors/__dir__.ini @@ -0,0 +1 @@ +disabled: SharedWorker diff --git a/tests/wpt/metadata/workers/semantics/structured-clone/__dir__.ini b/tests/wpt/metadata/workers/semantics/structured-clone/__dir__.ini new file mode 100644 index 00000000000..879844e9bd2 --- /dev/null +++ b/tests/wpt/metadata/workers/semantics/structured-clone/__dir__.ini @@ -0,0 +1 @@ +disabled: Broken somehow |