fix(examples): deadlock on api example unit test (#8671)

This commit is contained in:
Lucas Fernandes Nogueira
2024-01-24 21:52:28 -03:00
committed by GitHub
parent 30a64a9cda
commit 049ca2d54f
2 changed files with 5 additions and 4 deletions

View File

@@ -856,7 +856,7 @@ pub struct MockRuntime {
impl MockRuntime {
fn init() -> Self {
let is_running = Arc::new(AtomicBool::new(false));
let (tx, rx) = sync_channel(1);
let (tx, rx) = sync_channel(256);
let context = RuntimeContext {
is_running: is_running.clone(),
windows: Default::default(),

View File

@@ -41,7 +41,7 @@ pub fn run_app<R: Runtime, F: FnOnce(&App<R>) + Send + 'static>(
let mut builder = builder
.plugin(tauri_plugin_sample::init())
.setup(move |app| {
#[cfg(desktop)]
#[cfg(all(desktop, not(test)))]
{
let handle = app.handle();
tray::create_tray(handle)?;
@@ -51,7 +51,7 @@ pub fn run_app<R: Runtime, F: FnOnce(&App<R>) + Send + 'static>(
#[cfg(target_os = "macos")]
app.manage(AppMenu::<R>(Default::default()));
#[cfg(desktop)]
#[cfg(all(desktop, not(test)))]
app.manage(PopupMenu(
tauri::menu::MenuBuilder::new(app)
.check("check", "Tauri is awesome!")
@@ -61,7 +61,8 @@ pub fn run_app<R: Runtime, F: FnOnce(&App<R>) + Send + 'static>(
));
let mut window_builder = WebviewWindowBuilder::new(app, "main", WebviewUrl::default());
#[cfg(desktop)]
#[cfg(all(desktop, not(test)))]
{
window_builder = window_builder
.title("Tauri API Validation")