Skip to content

Commit

Permalink
fix wasm test compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 4, 2024
1 parent 6c9c63a commit bfc8e7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub async fn initialize_adapter(adapter_index: usize) -> (Instance, Adapter, Opt
let canvas = initialize_html_canvas();

_surface = instance
.create_surface_from_canvas(canvas.clone())
.create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
.expect("could not create surface from canvas");

surface_guard = Some(SurfaceGuard { canvas });
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/create_surface_error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Test that `create_surface_*()` accurately reports those errors we can provoke.

/// This test applies to those cfgs that have a `create_surface_from_canvas` method, which
/// This test applies to those cfgs that can create a surface from a canvas, which
/// include WebGL and WebGPU, but *not* Emscripten GLES.
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
#[wasm_bindgen_test::wasm_bindgen_test]
Expand All @@ -15,7 +15,7 @@ fn canvas_get_context_returned_null() {

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

assert!(
Expand Down

0 comments on commit bfc8e7e

Please sign in to comment.