{"record":{"id":"a919c818a1f64a90","repo":"slint-ui/slint","slug":"access-testing-window-called-without-testing-backe","errorCode":null,"errorMessage":"access_testing_window called without testing backend/adapter","messagePattern":"access_testing_window called without testing backend/adapter","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/testing/internal_tests.rs","lineNumber":193,"sourceCode":"            position: i_slint_core::lengths::logical_point_from_api(\n                i_slint_core::api::LogicalPosition::new(center_x, center_y),\n            ),\n            delta,\n            phase,\n        },\n    ));\n}\n\npub fn access_testing_window<R>(\n    window: &i_slint_core::api::Window,\n    callback: impl FnOnce(&TestingWindow) -> R,\n) -> R {\n    i_slint_core::window::WindowInner::from_pub(window)\n        .window_adapter()\n        .internal(i_slint_core::InternalToken)\n        .and_then(|wa| (wa as &dyn core::any::Any).downcast_ref::<TestingWindow>())\n        .map(callback)\n        .expect(\"access_testing_window called without testing backend/adapter\")\n}\n\n/// Runs a future to completion by polling the future and updating the mock time until the future is ready\npub fn block_on<R>(future: impl Future<Output = R>) -> R {\n    let mut pinned = core::pin::pin!(future);\n    let mut ctx = core::task::Context::from_waker(core::task::Waker::noop());\n    loop {\n        if let core::task::Poll::Ready(r) = pinned.as_mut().poll(&mut ctx) {\n            return r;\n        }\n        let duration = i_slint_core::platform::duration_until_next_timer_update()\n            .unwrap_or(core::time::Duration::from_secs(1));\n        crate::testing_backend::mock_elapsed_time(duration.as_millis() as u64);\n    }\n}\n","sourceCodeStart":175,"sourceCodeEnd":209,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/backends/testing/internal_tests.rs#L175-L209","documentation":"Error \"access_testing_window called without testing backend/adapter\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/backends/testing/internal_tests.rs:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Initialize the testing backend before accessing the testing window.","Verify the window was created by the testing adapter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}