|
1 |
| -use bitwarden_threading::cancellation_token::{ |
2 |
| - wasm::{AbortController, AbortControllerExt, CancellationTokenExt}, |
3 |
| - CancellationToken, |
4 |
| -}; |
5 |
| -use bitwarden_threading::time::sleep; |
6 | 1 | use std::time::Duration;
|
| 2 | + |
| 3 | +use bitwarden_threading::{ |
| 4 | + cancellation_token::{ |
| 5 | + wasm::{AbortController, AbortControllerExt, CancellationTokenExt}, |
| 6 | + CancellationToken, |
| 7 | + }, |
| 8 | + time::sleep, |
| 9 | +}; |
7 | 10 | use wasm_bindgen::externref_heap_live_count;
|
8 | 11 | use wasm_bindgen_test::wasm_bindgen_test;
|
9 | 12 |
|
@@ -145,7 +148,8 @@ mod to_bidirectional_abort_controller {
|
145 | 148 | // Dropping the token should the internal strong reference to the JS object, leaving us
|
146 | 149 | // with only the strong reference that was returned to the caller.
|
147 | 150 | // We check this because the reference is kept within a spawn_local future and it'll only be
|
148 |
| - // dropped when the future is dropped. And the future needs to be dropped or we'll leak memory. |
| 151 | + // dropped when the future is dropped. And the future needs to be dropped or we'll leak |
| 152 | + // memory. |
149 | 153 | assert_eq!(
|
150 | 154 | heap_count_after_dropping_guard,
|
151 | 155 | heap_count_after_creating_abort_controller - 1,
|
@@ -292,7 +296,8 @@ mod to_bidirectional_cancellation_token {
|
292 | 296 | // Dropping the token should the internal strong reference to the JS object, leaving us
|
293 | 297 | // with only the strong reference that was returned to the caller.
|
294 | 298 | // We check this because the reference is kept within a spawn_local future and it'll only be
|
295 |
| - // dropped when the future is dropped. And the future needs to be dropped or we'll leak memory. |
| 299 | + // dropped when the future is dropped. And the future needs to be dropped or we'll leak |
| 300 | + // memory. |
296 | 301 | assert_eq!(
|
297 | 302 | heap_count_after_dropping_guard, heap_count_before_creating_cancellation_token,
|
298 | 303 | "Dropping the token should drop the internal strong reference to the JS object"
|
|
0 commit comments