From b3c53dd08f3723a3302aa5da4b04b18a4184a782 Mon Sep 17 00:00:00 2001 From: Michael Goldenberg Date: Thu, 7 Aug 2025 14:21:42 -0400 Subject: [PATCH] test(indexeddb): run time-based integration tests on event cache Signed-off-by: Michael Goldenberg --- Cargo.lock | 1 + crates/matrix-sdk-indexeddb/Cargo.toml | 1 + .../matrix-sdk-indexeddb/src/event_cache_store/mod.rs | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 3bbf0fc04..1070774aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3336,6 +3336,7 @@ dependencies = [ "async-trait", "base64", "getrandom 0.2.15", + "gloo-timers", "gloo-utils", "growable-bloom-filter", "hkdf", diff --git a/crates/matrix-sdk-indexeddb/Cargo.toml b/crates/matrix-sdk-indexeddb/Cargo.toml index 417522240..d4a28d505 100644 --- a/crates/matrix-sdk-indexeddb/Cargo.toml +++ b/crates/matrix-sdk-indexeddb/Cargo.toml @@ -51,6 +51,7 @@ getrandom = { workspace = true, features = ["js"] } [dev-dependencies] assert_matches.workspace = true assert_matches2.workspace = true +gloo-timers = { workspace = true, features = ["futures"] } matrix-sdk-base = { workspace = true, features = ["testing"] } matrix-sdk-common = { workspace = true, features = ["js"] } matrix-sdk-crypto = { workspace = true, features = ["js", "testing"] } diff --git a/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs b/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs index 1c1b020e5..2d7ec100f 100644 --- a/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs +++ b/crates/matrix-sdk-indexeddb/src/event_cache_store/mod.rs @@ -671,7 +671,10 @@ impl_event_cache_store! { #[cfg(test)] mod tests { - use matrix_sdk_base::event_cache::store::{EventCacheStore, EventCacheStoreError}; + use matrix_sdk_base::{ + event_cache::store::{EventCacheStore, EventCacheStoreError}, + event_cache_store_integration_tests_time, + }; use matrix_sdk_test::async_test; use uuid::Uuid; @@ -695,6 +698,9 @@ mod tests { #[cfg(target_family = "wasm")] indexeddb_event_cache_store_integration_tests!(); + + #[cfg(target_family = "wasm")] + event_cache_store_integration_tests_time!(); } mod encrypted { @@ -712,5 +718,8 @@ mod tests { #[cfg(target_family = "wasm")] indexeddb_event_cache_store_integration_tests!(); + + #[cfg(target_family = "wasm")] + event_cache_store_integration_tests_time!(); } }