Skip to content

Commit bfc8e7e

Browse files
committed
fix wasm test compilation
1 parent 6c9c63a commit bfc8e7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/src/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub async fn initialize_adapter(adapter_index: usize) -> (Instance, Adapter, Opt
5151
let canvas = initialize_html_canvas();
5252

5353
_surface = instance
54-
.create_surface_from_canvas(canvas.clone())
54+
.create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
5555
.expect("could not create surface from canvas");
5656

5757
surface_guard = Some(SurfaceGuard { canvas });

tests/tests/create_surface_error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Test that `create_surface_*()` accurately reports those errors we can provoke.
22
3-
/// This test applies to those cfgs that have a `create_surface_from_canvas` method, which
3+
/// This test applies to those cfgs that can create a surface from a canvas, which
44
/// include WebGL and WebGPU, but *not* Emscripten GLES.
55
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
66
#[wasm_bindgen_test::wasm_bindgen_test]
@@ -15,7 +15,7 @@ fn canvas_get_context_returned_null() {
1515

1616
#[allow(clippy::redundant_clone)] // false positive — can't and shouldn't move out.
1717
let error = instance
18-
.create_surface_from_canvas(canvas.clone())
18+
.create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
1919
.unwrap_err();
2020

2121
assert!(

0 commit comments

Comments
 (0)