Skip to content

Commit 105e2f9

Browse files
committed
fix: tests passing
1 parent efae34d commit 105e2f9

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ jobs:
306306
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
307307

308308
- name: Run Wasm tests
309-
run: wasm-pack test --chrome --chromedriver ${{ steps.setup-chrome.outputs.chromedriver-path }} --headless --no-default-features --features rust_native_crypto
309+
run: wasm-pack test --chrome --chromedriver ${{ steps.setup-chrome.outputs.chromedriver-path }} --headless --no-default-features --features rust_native_crypto,fetch_remote_manifests
310310
working-directory: ./sdk
311311
env:
312312
WASM_BINDGEN_TEST_TIMEOUT: 60

sdk/src/store.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4231,7 +4231,11 @@ impl Store {
42314231
verify: bool,
42324232
validation_log: &mut StatusTracker,
42334233
) -> Result<Self> {
4234-
let (manifest_bytes, remote_url) = Store::load_jumbf_from_stream(format, &mut stream)?;
4234+
let (manifest_bytes, remote_url) = if _sync {
4235+
Store::load_jumbf_from_stream(format, &mut stream)?
4236+
} else {
4237+
Store::load_jumbf_from_stream_async(format, &mut stream).await?
4238+
};
42354239

42364240
let store = if _sync {
42374241
Self::from_manifest_data_and_stream(

sdk/tests/test_reader.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
mod common;
1515
use c2pa::{validation_status, Error, Reader, Result};
1616
use common::{assert_err, compare_to_known_good, fixture_stream};
17-
#[cfg(not(target_os = "wasi"))]
17+
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
1818
use wasm_bindgen_test::wasm_bindgen_test;
1919
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
2020
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
@@ -67,8 +67,12 @@ fn test_reader_xca_jpg() -> Result<()> {
6767
compare_to_known_good(&reader, "XCA.json")
6868
}
6969

70-
#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
71-
#[wasm_bindgen_test]
70+
#[cfg(not(target_os = "wasi"))]
71+
#[cfg_attr(not(target_arch = "wasm32"), actix::test)]
72+
#[cfg_attr(
73+
all(target_arch = "wasm32", not(target_os = "wasi")),
74+
wasm_bindgen_test
75+
)]
7276
async fn test_reader_remote_url_async() -> Result<()> {
7377
let reader = Reader::from_stream_async(
7478
"image/jpeg",

0 commit comments

Comments
 (0)