summaryrefslogtreecommitdiffstats
path: root/vendor/web-sys/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/web-sys/tests
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.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')
-rw-r--r--vendor/web-sys/tests/wasm/whitelisted_immutable_slices.rs21
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() {