diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
commit | 018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch) | |
tree | a835ebdf2088ef88fa681f8fad45f09922c1ae9a /vendor/web-sys/tests/wasm | |
parent | Adding debian version 1.75.0+dfsg1-5. (diff) | |
download | rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/web-sys/tests/wasm')
-rw-r--r-- | vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs | 21 |
1 files changed, 21 insertions, 0 deletions
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::<FileSystemSyncAccessHandle>(); + let opt = JsValue::null().unchecked_into::<FileSystemReadWriteOptions>(); + + 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::<FileSystemWritableFileStream>(); + wf.write_with_u8_array(&[0]); +} + // TODO: //#[wasm_bindgen_test] //fn test_another_types_immutable_slices_here() { |