From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- .../tests/wasm/whitelisted_immutable_slices.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'vendor/web-sys/tests') diff --git a/vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 14bda73c0..30d70bf3f 100644 --- a/vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -11,6 +11,10 @@ //! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 use wasm_bindgen::{JsCast, JsValue}; +#[cfg(web_sys_unstable_apis)] +use web_sys::{ + FileSystemReadWriteOptions, FileSystemSyncAccessHandle, FileSystemWritableFileStream, +}; use web_sys::{WebGl2RenderingContext, WebGlRenderingContext, WebSocket}; // Ensure that our whitelisted WebGlRenderingContext methods compile with immutable slices. @@ -71,6 +75,23 @@ fn test_websocket_immutable_slices() { ws.send_with_u8_array(&[0]); } +// Ensure that our whitelisted FileSystemSyncAccessHandle methods compile with immutable slices. +#[cfg(web_sys_unstable_apis)] +fn test_file_system_sync_access_handle_immutable_slices() { + let sa = JsValue::null().unchecked_into::(); + let opt = JsValue::null().unchecked_into::(); + + sa.write_with_u8_array(&[0]); + sa.write_with_u8_array_and_options(&[0], &opt); +} + +// Ensure that our whitelisted FileSystemWritableFileStream methods compile with immutable slices. +#[cfg(web_sys_unstable_apis)] +fn test_file_system_writable_file_stream_immutable_slices() { + let wf = JsValue::null().unchecked_into::(); + wf.write_with_u8_array(&[0]); +} + // TODO: //#[wasm_bindgen_test] //fn test_another_types_immutable_slices_here() { -- cgit v1.2.3