From 53b6343f3c2bb54bf2f541d88efcb4ce47e4eb7a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 14 Oct 2016 11:28:25 +0200 Subject: [PATCH 1/7] Add missing type to uniformOutOfBounds.html.ini. --- .../conformance/more/glsl/uniformOutOfBounds.html.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/glsl/uniformOutOfBounds.html.ini b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/glsl/uniformOutOfBounds.html.ini index a4c47444af43..c2797480f565 100644 --- a/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/glsl/uniformOutOfBounds.html.ini +++ b/tests/wpt/metadata/webgl/conformance-1.0.3/conformance/more/glsl/uniformOutOfBounds.html.ini @@ -1,2 +1,3 @@ [uniformOutOfBounds.html] + type: testharness disabled: https://github.com/servo/servo/issues/13662 From d82038775807faf3dcce7ec72e1f0d5213105888 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2016 13:39:42 +0200 Subject: [PATCH 2/7] Stop wrapping FileManager in an Arc. It already contains an Arc internally. --- components/net/blob_loader.rs | 4 ++-- components/net/filemanager_thread.rs | 9 +++++++++ components/net/resource_thread.rs | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/net/blob_loader.rs b/components/net/blob_loader.rs index 1bf931dac32b..bb9537e48ddf 100644 --- a/components/net/blob_loader.rs +++ b/components/net/blob_loader.rs @@ -23,7 +23,7 @@ use util::thread::spawn_named; // TODO: Check on GET // https://w3c.github.io/FileAPI/#requestResponseModel -pub fn factory(filemanager: Arc>) +pub fn factory(filemanager: FileManager) -> Box, CancellationListener) + Send> { box move |load_data: LoadData, start_chan, classifier, cancel_listener| { spawn_named(format!("blob loader for {}", load_data.url), move || { @@ -35,7 +35,7 @@ pub fn factory(filemanager: Arc>) fn load_blob (load_data: LoadData, start_chan: LoadConsumer, classifier: Arc, - filemanager: Arc>, + filemanager: FileManager, cancel_listener: CancellationListener) { let (chan, recv) = ipc::channel().unwrap(); if let Ok((id, origin, _fragment)) = parse_blob_url(&load_data.url.clone()) { diff --git a/components/net/filemanager_thread.rs b/components/net/filemanager_thread.rs index ac8ad70d1bc8..d682ea02569b 100644 --- a/components/net/filemanager_thread.rs +++ b/components/net/filemanager_thread.rs @@ -116,6 +116,15 @@ pub struct FileManager { store: Arc>, } +// Not derived to avoid an unnecessary `UI: Clone` bound. +impl Clone for FileManager { + fn clone(&self) -> Self { + FileManager { + store: self.store.clone(), + } + } +} + impl FileManager { pub fn new(ui: &'static UI) -> FileManager { FileManager { diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 86e382e4bb3e..6f596684408b 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -475,7 +475,7 @@ pub struct CoreResourceManager { devtools_chan: Option>, swmanager_chan: Option>, profiler_chan: ProfilerChan, - filemanager: Arc>, + filemanager: FileManager, cancel_load_map: HashMap>, next_resource_id: ResourceId, } @@ -490,7 +490,7 @@ impl CoreResourceManager { devtools_chan: devtools_channel, swmanager_chan: None, profiler_chan: profiler_chan, - filemanager: Arc::new(FileManager::new(TFD_PROVIDER)), + filemanager: FileManager::new(TFD_PROVIDER), cancel_load_map: HashMap::new(), next_resource_id: ResourceId(0), } From fc68e0a6caa43b1f91194a5101644fa26dd7bd72 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2016 13:45:36 +0200 Subject: [PATCH 3/7] Add a FileManager to FetchContext. --- components/net/fetch/methods.rs | 87 +++++++++++++++++----------- components/net/resource_thread.rs | 8 ++- tests/unit/net/fetch.rs | 5 +- tests/unit/net/filemanager_thread.rs | 4 +- 4 files changed, 66 insertions(+), 38 deletions(-) diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index e1e66b37f9d8..717ddb784e17 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -6,6 +6,7 @@ use connector::create_http_connector; use data_loader::decode; use devtools_traits::DevtoolsControlMsg; use fetch::cors_cache::CORSCache; +use filemanager_thread::{FileManager, UIProvider}; use http_loader::{HttpState, set_default_accept_encoding, set_request_cookies}; use http_loader::{NetworkHttpRequestFactory, ReadResult, StreamedResponse, obtain_response, read_block}; use http_loader::{auth_from_cache, determine_request_referrer}; @@ -50,23 +51,28 @@ enum Data { Done, } -pub struct FetchContext { +pub struct FetchContext { pub state: HttpState, pub user_agent: Cow<'static, str>, pub devtools_chan: Option>, + pub filemanager: FileManager, } type DoneChannel = Option<(Sender, Receiver)>; /// [Fetch](https://fetch.spec.whatwg.org#concept-fetch) -pub fn fetch(request: Rc, target: &mut Target, context: FetchContext) -> Response { +pub fn fetch(request: Rc, + target: &mut Target, + context: FetchContext) + -> Response { fetch_with_cors_cache(request, &mut CORSCache::new(), target, context) } -pub fn fetch_with_cors_cache(request: Rc, - cache: &mut CORSCache, - target: &mut Target, - context: FetchContext) -> Response { +pub fn fetch_with_cors_cache(request: Rc, + cache: &mut CORSCache, + target: &mut Target, + context: FetchContext) + -> Response { // Step 1 if request.window.get() == Window::Client { // TODO: Set window to request's client object if client is a Window object @@ -131,9 +137,14 @@ pub fn fetch_with_cors_cache(request: Rc, } /// [Main fetch](https://fetch.spec.whatwg.org/#concept-main-fetch) -fn main_fetch(request: Rc, cache: &mut CORSCache, cors_flag: bool, - recursive_flag: bool, target: &mut Target, done_chan: &mut DoneChannel, - context: &FetchContext) -> Response { +fn main_fetch(request: Rc, + cache: &mut CORSCache, + cors_flag: bool, + recursive_flag: bool, + target: &mut Target, + done_chan: &mut DoneChannel, + context: &FetchContext) + -> Response { // TODO: Implement main fetch spec // Step 1 @@ -389,9 +400,12 @@ fn main_fetch(request: Rc, cache: &mut CORSCache, cors_flag: bool, } /// [Basic fetch](https://fetch.spec.whatwg.org#basic-fetch) -fn basic_fetch(request: Rc, cache: &mut CORSCache, - target: &mut Target, done_chan: &mut DoneChannel, - context: &FetchContext) -> Response { +fn basic_fetch(request: Rc, + cache: &mut CORSCache, + target: &mut Target, + done_chan: &mut DoneChannel, + context: &FetchContext) + -> Response { let url = request.current_url(); match url.scheme() { @@ -460,14 +474,15 @@ fn basic_fetch(request: Rc, cache: &mut CORSCache, } /// [HTTP fetch](https://fetch.spec.whatwg.org#http-fetch) -fn http_fetch(request: Rc, - cache: &mut CORSCache, - cors_flag: bool, - cors_preflight_flag: bool, - authentication_fetch_flag: bool, - target: &mut Target, - done_chan: &mut DoneChannel, - context: &FetchContext) -> Response { +fn http_fetch(request: Rc, + cache: &mut CORSCache, + cors_flag: bool, + cors_preflight_flag: bool, + authentication_fetch_flag: bool, + target: &mut Target, + done_chan: &mut DoneChannel, + context: &FetchContext) + -> Response { // This is a new async fetch, reset the channel we are waiting on *done_chan = None; // Step 1 @@ -631,13 +646,14 @@ fn http_fetch(request: Rc, } /// [HTTP redirect fetch](https://fetch.spec.whatwg.org#http-redirect-fetch) -fn http_redirect_fetch(request: Rc, - cache: &mut CORSCache, - response: Rc, - cors_flag: bool, - target: &mut Target, - done_chan: &mut DoneChannel, - context: &FetchContext) -> Response { +fn http_redirect_fetch(request: Rc, + cache: &mut CORSCache, + response: Rc, + cors_flag: bool, + target: &mut Target, + done_chan: &mut DoneChannel, + context: &FetchContext) + -> Response { // Step 1 assert_eq!(response.return_internal.get(), true); @@ -711,11 +727,12 @@ fn http_redirect_fetch(request: Rc, } /// [HTTP network or cache fetch](https://fetch.spec.whatwg.org#http-network-or-cache-fetch) -fn http_network_or_cache_fetch(request: Rc, - credentials_flag: bool, - authentication_fetch_flag: bool, - done_chan: &mut DoneChannel, - context: &FetchContext) -> Response { +fn http_network_or_cache_fetch(request: Rc, + credentials_flag: bool, + authentication_fetch_flag: bool, + done_chan: &mut DoneChannel, + context: &FetchContext) + -> Response { // TODO: Implement Window enum for Request let request_has_no_window = true; @@ -1108,8 +1125,10 @@ fn http_network_fetch(request: Rc, } /// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch) -fn cors_preflight_fetch(request: Rc, cache: &mut CORSCache, - context: &FetchContext) -> Response { +fn cors_preflight_fetch(request: Rc, + cache: &mut CORSCache, + context: &FetchContext) + -> Response { // Step 1 let mut preflight = Request::new(request.current_url(), Some(request.origin.borrow().clone()), request.is_service_worker_global_scope, request.pipeline_id.get()); diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 6f596684408b..e6606b87b8c5 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -592,6 +592,7 @@ impl CoreResourceManager { }; let ua = self.user_agent.clone(); let dc = self.devtools_chan.clone(); + let filemanager = self.filemanager.clone(); spawn_named(format!("fetch thread for {}", init.url), move || { let request = Request::from_init(init); // XXXManishearth: Check origin against pipeline id (also ensure that the mode is allowed) @@ -599,7 +600,12 @@ impl CoreResourceManager { // todo referrer policy? // todo service worker stuff let mut target = Some(Box::new(sender) as Box); - let context = FetchContext { state: http_state, user_agent: ua, devtools_chan: dc }; + let context = FetchContext { + state: http_state, + user_agent: ua, + devtools_chan: dc, + filemanager: filemanager, + }; fetch(Rc::new(request), &mut target, context); }) } diff --git a/tests/unit/net/fetch.rs b/tests/unit/net/fetch.rs index 7f3685166566..10156af5486b 100644 --- a/tests/unit/net/fetch.rs +++ b/tests/unit/net/fetch.rs @@ -5,6 +5,7 @@ use devtools_traits::DevtoolsControlMsg; use devtools_traits::HttpRequest as DevtoolsHttpRequest; use devtools_traits::HttpResponse as DevtoolsHttpResponse; +use filemanager_thread::{TestProvider, TEST_PROVIDER}; use http_loader::{expect_devtools_http_request, expect_devtools_http_response}; use hyper::LanguageTag; use hyper::header::{Accept, AccessControlAllowCredentials, AccessControlAllowHeaders, AccessControlAllowOrigin}; @@ -22,6 +23,7 @@ use hyper::uri::RequestUri; use msg::constellation_msg::{ReferrerPolicy, TEST_PIPELINE_ID}; use net::fetch::cors_cache::CORSCache; use net::fetch::methods::{FetchContext, fetch, fetch_with_cors_cache}; +use net::filemanager_thread::FileManager; use net::http_loader::HttpState; use net_traits::FetchTaskTarget; use net_traits::request::{Origin, RedirectMode, Referrer, Request, RequestMode}; @@ -46,11 +48,12 @@ struct FetchResponseCollector { sender: Sender, } -fn new_fetch_context(dc: Option>) -> FetchContext { +fn new_fetch_context(dc: Option>) -> FetchContext { FetchContext { state: HttpState::new(), user_agent: DEFAULT_USER_AGENT.into(), devtools_chan: dc, + filemanager: FileManager::new(TEST_PROVIDER), } } impl FetchTaskTarget for FetchResponseCollector { diff --git a/tests/unit/net/filemanager_thread.rs b/tests/unit/net/filemanager_thread.rs index 7266157481ac..75facb0b6aab 100644 --- a/tests/unit/net/filemanager_thread.rs +++ b/tests/unit/net/filemanager_thread.rs @@ -10,9 +10,9 @@ use std::fs::File; use std::io::Read; use std::path::PathBuf; -const TEST_PROVIDER: &'static TestProvider = &TestProvider; +pub const TEST_PROVIDER: &'static TestProvider = &TestProvider; -struct TestProvider; +pub struct TestProvider; impl UIProvider for TestProvider { fn open_file_dialog(&self, _path: &str, _patterns: Vec) -> Option { From c513b5f2266c032040d615812fba463b053ee5b5 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2016 14:09:06 +0200 Subject: [PATCH 4/7] Avoid an unnecessary clone when calling FileManagerStore::try_read_file. --- components/net/filemanager_thread.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/net/filemanager_thread.rs b/components/net/filemanager_thread.rs index d682ea02569b..567d2f187401 100644 --- a/components/net/filemanager_thread.rs +++ b/components/net/filemanager_thread.rs @@ -148,7 +148,7 @@ impl FileManager { } FileManagerThreadMsg::ReadFile(sender, id, check_url_validity, origin) => { spawn_named("read file".to_owned(), move || { - if let Err(e) = store.try_read_file(sender.clone(), id, check_url_validity, + if let Err(e) = store.try_read_file(&sender, id, check_url_validity, origin, cancel_listener) { let _ = sender.send(Err(FileManagerThreadError::BlobURLStoreError(e))); } @@ -374,7 +374,7 @@ impl FileManagerStore { }) } - fn get_blob_buf(&self, sender: IpcSender>, + fn get_blob_buf(&self, sender: &IpcSender>, id: &Uuid, origin_in: &FileOrigin, rel_pos: RelativePos, check_url_validity: bool, cancel_listener: Option) -> Result<(), BlobURLStoreError> { @@ -437,7 +437,7 @@ impl FileManagerStore { } // Convenient wrapper over get_blob_buf - fn try_read_file(&self, sender: IpcSender>, + fn try_read_file(&self, sender: &IpcSender>, id: Uuid, check_url_validity: bool, origin_in: FileOrigin, cancel_listener: Option) -> Result<(), BlobURLStoreError> { self.get_blob_buf(sender, &id, &origin_in, RelativePos::full_range(), check_url_validity, cancel_listener) @@ -550,7 +550,7 @@ fn select_files_pref_enabled() -> bool { const CHUNK_SIZE: usize = 8192; -fn chunked_read(sender: IpcSender>, +fn chunked_read(sender: &IpcSender>, file: &mut File, size: usize, opt_filename: Option, type_string: String, cancel_listener: Option) { // First chunk From 92f1cbcbe3550c3456e5db873c80ef086b72991a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2016 14:12:25 +0200 Subject: [PATCH 5/7] Stop spawning threads unnecessarily in FileManager. The spawned threads remain for select_file and select_files, as those may need to wait indefinitely for the user's response. --- components/net/filemanager_thread.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/components/net/filemanager_thread.rs b/components/net/filemanager_thread.rs index 567d2f187401..5b520b9e31db 100644 --- a/components/net/filemanager_thread.rs +++ b/components/net/filemanager_thread.rs @@ -160,24 +160,16 @@ impl FileManager { }) } FileManagerThreadMsg::AddSlicedURLEntry(id, rel_pos, sender, origin) =>{ - spawn_named("add sliced URL entry".to_owned(), move || { - store.add_sliced_url_entry(id, rel_pos, sender, origin); - }) + store.add_sliced_url_entry(id, rel_pos, sender, origin); } FileManagerThreadMsg::DecRef(id, origin, sender) => { - spawn_named("dec ref".to_owned(), move || { - let _ = sender.send(store.dec_ref(&id, &origin)); - }) + let _ = sender.send(store.dec_ref(&id, &origin)); } FileManagerThreadMsg::RevokeBlobURL(id, origin, sender) => { - spawn_named("revoke blob url".to_owned(), move || { - let _ = sender.send(store.set_blob_url_validity(false, &id, &origin)); - }) + let _ = sender.send(store.set_blob_url_validity(false, &id, &origin)); } FileManagerThreadMsg::ActivateBlobURL(id, sender, origin) => { - spawn_named("activate blob url".to_owned(), move || { - let _ = sender.send(store.set_blob_url_validity(true, &id, &origin)); - }); + let _ = sender.send(store.set_blob_url_validity(true, &id, &origin)); } } } From e134871a95c43e4938fddb48b5b8398f896178ed Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 13 Oct 2016 17:01:24 +0200 Subject: [PATCH 6/7] Implement blob url support in the fetch stack. --- components/net/blob_loader.rs | 70 +++++++++++++++++++ components/net/fetch/methods.rs | 25 ++++++- tests/unit/net/fetch.rs | 42 +++++++++++ .../FileAPI/blob/Blob-XHR-revoke.html.ini | 4 +- .../api/basic/scheme-blob-worker.html.ini | 5 +- .../fetch/api/basic/scheme-blob.html.ini | 5 +- 6 files changed, 147 insertions(+), 4 deletions(-) diff --git a/components/net/blob_loader.rs b/components/net/blob_loader.rs index bb9537e48ddf..9bd4eec04c90 100644 --- a/components/net/blob_loader.rs +++ b/components/net/blob_loader.rs @@ -18,6 +18,7 @@ use resource_thread::{send_error, start_sending_sniffed_opt}; use resource_thread::CancellationListener; use std::boxed::FnBox; use std::sync::Arc; +use url::Url; use util::thread::spawn_named; // TODO: Check on GET @@ -119,3 +120,72 @@ fn load_blob send_error(load_data.url.clone(), format_err, start_chan); } } + +/// https://fetch.spec.whatwg.org/#concept-basic-fetch (partial) +// TODO: make async. +pub fn load_blob_sync + (url: Url, + filemanager: FileManager) + -> Result<(Headers, Vec), NetworkError> { + let (id, origin) = match parse_blob_url(&url) { + Ok((id, origin, _fragment)) => (id, origin), + Err(()) => { + let e = format!("Invalid blob URL format {:?}", url); + return Err(NetworkError::Internal(e)); + } + }; + + let (sender, receiver) = ipc::channel().unwrap(); + let check_url_validity = true; + let msg = FileManagerThreadMsg::ReadFile(sender, id, check_url_validity, origin); + let _ = filemanager.handle(msg, None); + + let blob_buf = match receiver.recv().unwrap() { + Ok(ReadFileProgress::Meta(blob_buf)) => blob_buf, + Ok(_) => { + return Err(NetworkError::Internal("Invalid filemanager reply".to_string())); + } + Err(e) => { + return Err(NetworkError::Internal(format!("{:?}", e))); + } + }; + + let content_type: Mime = blob_buf.type_string.parse().unwrap_or(mime!(Text / Plain)); + let charset = content_type.get_param(Attr::Charset); + + let mut headers = Headers::new(); + + if let Some(name) = blob_buf.filename { + let charset = charset.and_then(|c| c.as_str().parse().ok()); + headers.set(ContentDisposition { + disposition: DispositionType::Inline, + parameters: vec![ + DispositionParam::Filename(charset.unwrap_or(Charset::Us_Ascii), + None, name.as_bytes().to_vec()) + ] + }); + } + + // Basic fetch, Step 4. + headers.set(ContentLength(blob_buf.size as u64)); + // Basic fetch, Step 5. + headers.set(ContentType(content_type.clone())); + + let mut bytes = blob_buf.bytes; + loop { + match receiver.recv().unwrap() { + Ok(ReadFileProgress::Partial(ref mut new_bytes)) => { + bytes.append(new_bytes); + } + Ok(ReadFileProgress::EOF) => { + return Ok((headers, bytes)); + } + Ok(_) => { + return Err(NetworkError::Internal("Invalid filemanager reply".to_string())); + } + Err(e) => { + return Err(NetworkError::Internal(format!("{:?}", e))); + } + } + } +} diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index 717ddb784e17..0d5b2d2835e4 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -2,6 +2,7 @@ * 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 blob_loader::load_blob_sync; use connector::create_http_connector; use data_loader::decode; use devtools_traits::DevtoolsControlMsg; @@ -464,7 +465,29 @@ fn basic_fetch(request: Rc, } }, - "blob" | "ftp" => { + "blob" => { + println!("Loading blob {}", url.as_str()); + // Step 2. + if *request.method.borrow() != Method::Get { + return Response::network_error(); + } + + match load_blob_sync(url.clone(), context.filemanager.clone()) { + Ok((headers, bytes)) => { + let mut response = Response::new(); + response.url = Some(url.clone()); + response.headers = headers; + *response.body.lock().unwrap() = ResponseBody::Done(bytes); + response + }, + Err(e) => { + debug!("Failed to load {}: {:?}", url, e); + Response::network_error() + }, + } + }, + + "ftp" => { // XXXManishearth handle these panic!("Unimplemented scheme for Fetch") }, diff --git a/tests/unit/net/fetch.rs b/tests/unit/net/fetch.rs index 10156af5486b..60f6456ed0a1 100644 --- a/tests/unit/net/fetch.rs +++ b/tests/unit/net/fetch.rs @@ -167,6 +167,48 @@ fn test_fetch_data() { } } +#[test] +fn test_fetch_blob() { + use ipc_channel::ipc; + use net_traits::blob_url_store::BlobBuf; + use net_traits::filemanager_thread::FileManagerThreadMsg; + + let context = new_fetch_context(None); + + let bytes = b"content"; + let blob_buf = BlobBuf { + filename: Some("test.txt".into()), + type_string: "text/plain".into(), + size: bytes.len() as u64, + bytes: bytes.to_vec(), + }; + + let origin = Url::parse("http://www.example.org/").unwrap(); + + let (sender, receiver) = ipc::channel().unwrap(); + let message = FileManagerThreadMsg::PromoteMemory(blob_buf, true, sender, "http://www.example.org".into()); + context.filemanager.handle(message, None); + let id = receiver.recv().unwrap().unwrap(); + let url = Url::parse(&format!("blob:{}{}", origin.as_str(), id.simple())).unwrap(); + + + let request = Request::new(url, Some(Origin::Origin(origin.origin())), false, None); + let fetch_response = fetch(Rc::new(request), &mut None, context); + + assert!(!fetch_response.is_network_error()); + + assert_eq!(fetch_response.headers.len(), 2); + + let content_type: &ContentType = fetch_response.headers.get().unwrap(); + assert_eq!(**content_type, Mime(TopLevel::Text, SubLevel::Plain, vec![])); + + let content_length: &ContentLength = fetch_response.headers.get().unwrap(); + assert_eq!(**content_length, bytes.len() as u64); + + assert_eq!(*fetch_response.body.lock().unwrap(), + ResponseBody::Done(bytes.to_vec())); +} + #[test] fn test_fetch_file() { let mut path = resources_dir_path().expect("Cannot find resource dir"); diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini index 6fb7d0ba5ca3..c427a661f26a 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini @@ -1,4 +1,6 @@ [Blob-XHR-revoke.html] type: testharness - expected: CRASH bug: https://github.com/servo/servo/issues/10539 + [Revoking blob URL used with XMLHttpRequest] + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/api/basic/scheme-blob-worker.html.ini b/tests/wpt/metadata/fetch/api/basic/scheme-blob-worker.html.ini index 742404398915..7c2d1d343b39 100644 --- a/tests/wpt/metadata/fetch/api/basic/scheme-blob-worker.html.ini +++ b/tests/wpt/metadata/fetch/api/basic/scheme-blob-worker.html.ini @@ -1,3 +1,6 @@ [scheme-blob-worker.html] type: testharness - expected: CRASH + [Fetching [GET\] URL.createObjectURL(blob) is OK] + bug: https://github.com/servo/servo/issues/13766 + expected: FAIL + diff --git a/tests/wpt/metadata/fetch/api/basic/scheme-blob.html.ini b/tests/wpt/metadata/fetch/api/basic/scheme-blob.html.ini index ef3371f4e384..599e25f7f0bd 100644 --- a/tests/wpt/metadata/fetch/api/basic/scheme-blob.html.ini +++ b/tests/wpt/metadata/fetch/api/basic/scheme-blob.html.ini @@ -1,3 +1,6 @@ [scheme-blob.html] type: testharness - expected: CRASH + [Fetching [GET\] URL.createObjectURL(blob) is OK] + bug: https://github.com/servo/servo/issues/13766 + expected: FAIL + From 6eaef7c18a546e5d5510cf1e2d6ab458a318ec8a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 14 Oct 2016 11:05:15 +0200 Subject: [PATCH 7/7] Update the bug number for Blob-XHR-revoke.html. --- components/script/dom/xmlhttprequest.rs | 2 +- tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 39cb2f3a9560..a9a2b0cb4769 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -366,7 +366,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest { // Step 11 - abort existing requests self.terminate_ongoing_fetch(); - // TODO(izgzhen): In the WPT test: FileAPI/blob/Blob-XHR-revoke.html, + // FIXME(#13767): In the WPT test: FileAPI/blob/Blob-XHR-revoke.html, // the xhr.open(url) is expected to hold a reference to the URL, // thus renders following revocations invalid. Though we won't // implement this for now, if ever needed, we should check blob diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini index c427a661f26a..75e645a94c9f 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini @@ -1,6 +1,6 @@ [Blob-XHR-revoke.html] type: testharness - bug: https://github.com/servo/servo/issues/10539 + bug: https://github.com/servo/servo/issues/13767 [Revoking blob URL used with XMLHttpRequest] expected: FAIL